3 #define PY_SSIZE_T_CLEAN
6 #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8 #error Cython requires Python 2.6+ or Python 3.3+.
10 #define CYTHON_ABI "0_28_5"
11 #define CYTHON_FUTURE_DIVISION 0
14 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #if !defined(WIN32) && !defined(MS_WINDOWS)
28 #define DL_IMPORT(t) t
31 #define DL_EXPORT(t) t
34 #ifndef HAVE_LONG_LONG
35 #if PY_VERSION_HEX >= 0x02070000
36 #define HAVE_LONG_LONG
40 #define PY_LONG_LONG LONG_LONG
43 #define Py_HUGE_VAL HUGE_VAL
46 #define CYTHON_COMPILING_IN_PYPY 1
47 #define CYTHON_COMPILING_IN_PYSTON 0
48 #define CYTHON_COMPILING_IN_CPYTHON 0
49 #undef CYTHON_USE_TYPE_SLOTS
50 #define CYTHON_USE_TYPE_SLOTS 0
51 #undef CYTHON_USE_PYTYPE_LOOKUP
52 #define CYTHON_USE_PYTYPE_LOOKUP 0
53 #if PY_VERSION_HEX < 0x03050000
54 #undef CYTHON_USE_ASYNC_SLOTS
55 #define CYTHON_USE_ASYNC_SLOTS 0
56 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
57 #define CYTHON_USE_ASYNC_SLOTS 1
59 #undef CYTHON_USE_PYLIST_INTERNALS
60 #define CYTHON_USE_PYLIST_INTERNALS 0
61 #undef CYTHON_USE_UNICODE_INTERNALS
62 #define CYTHON_USE_UNICODE_INTERNALS 0
63 #undef CYTHON_USE_UNICODE_WRITER
64 #define CYTHON_USE_UNICODE_WRITER 0
65 #undef CYTHON_USE_PYLONG_INTERNALS
66 #define CYTHON_USE_PYLONG_INTERNALS 0
67 #undef CYTHON_AVOID_BORROWED_REFS
68 #define CYTHON_AVOID_BORROWED_REFS 1
69 #undef CYTHON_ASSUME_SAFE_MACROS
70 #define CYTHON_ASSUME_SAFE_MACROS 0
71 #undef CYTHON_UNPACK_METHODS
72 #define CYTHON_UNPACK_METHODS 0
73 #undef CYTHON_FAST_THREAD_STATE
74 #define CYTHON_FAST_THREAD_STATE 0
75 #undef CYTHON_FAST_PYCALL
76 #define CYTHON_FAST_PYCALL 0
77 #undef CYTHON_PEP489_MULTI_PHASE_INIT
78 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
79 #undef CYTHON_USE_TP_FINALIZE
80 #define CYTHON_USE_TP_FINALIZE 0
81 #elif defined(PYSTON_VERSION)
82 #define CYTHON_COMPILING_IN_PYPY 0
83 #define CYTHON_COMPILING_IN_PYSTON 1
84 #define CYTHON_COMPILING_IN_CPYTHON 0
85 #ifndef CYTHON_USE_TYPE_SLOTS
86 #define CYTHON_USE_TYPE_SLOTS 1
88 #undef CYTHON_USE_PYTYPE_LOOKUP
89 #define CYTHON_USE_PYTYPE_LOOKUP 0
90 #undef CYTHON_USE_ASYNC_SLOTS
91 #define CYTHON_USE_ASYNC_SLOTS 0
92 #undef CYTHON_USE_PYLIST_INTERNALS
93 #define CYTHON_USE_PYLIST_INTERNALS 0
94 #ifndef CYTHON_USE_UNICODE_INTERNALS
95 #define CYTHON_USE_UNICODE_INTERNALS 1
97 #undef CYTHON_USE_UNICODE_WRITER
98 #define CYTHON_USE_UNICODE_WRITER 0
99 #undef CYTHON_USE_PYLONG_INTERNALS
100 #define CYTHON_USE_PYLONG_INTERNALS 0
101 #ifndef CYTHON_AVOID_BORROWED_REFS
102 #define CYTHON_AVOID_BORROWED_REFS 0
104 #ifndef CYTHON_ASSUME_SAFE_MACROS
105 #define CYTHON_ASSUME_SAFE_MACROS 1
107 #ifndef CYTHON_UNPACK_METHODS
108 #define CYTHON_UNPACK_METHODS 1
110 #undef CYTHON_FAST_THREAD_STATE
111 #define CYTHON_FAST_THREAD_STATE 0
112 #undef CYTHON_FAST_PYCALL
113 #define CYTHON_FAST_PYCALL 0
114 #undef CYTHON_PEP489_MULTI_PHASE_INIT
115 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
116 #undef CYTHON_USE_TP_FINALIZE
117 #define CYTHON_USE_TP_FINALIZE 0
119 #define CYTHON_COMPILING_IN_PYPY 0
120 #define CYTHON_COMPILING_IN_PYSTON 0
121 #define CYTHON_COMPILING_IN_CPYTHON 1
122 #ifndef CYTHON_USE_TYPE_SLOTS
123 #define CYTHON_USE_TYPE_SLOTS 1
125 #if PY_VERSION_HEX < 0x02070000
126 #undef CYTHON_USE_PYTYPE_LOOKUP
127 #define CYTHON_USE_PYTYPE_LOOKUP 0
128 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
129 #define CYTHON_USE_PYTYPE_LOOKUP 1
131 #if PY_MAJOR_VERSION < 3
132 #undef CYTHON_USE_ASYNC_SLOTS
133 #define CYTHON_USE_ASYNC_SLOTS 0
134 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
135 #define CYTHON_USE_ASYNC_SLOTS 1
137 #if PY_VERSION_HEX < 0x02070000
138 #undef CYTHON_USE_PYLONG_INTERNALS
139 #define CYTHON_USE_PYLONG_INTERNALS 0
140 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
141 #define CYTHON_USE_PYLONG_INTERNALS 1
143 #ifndef CYTHON_USE_PYLIST_INTERNALS
144 #define CYTHON_USE_PYLIST_INTERNALS 1
146 #ifndef CYTHON_USE_UNICODE_INTERNALS
147 #define CYTHON_USE_UNICODE_INTERNALS 1
149 #if PY_VERSION_HEX < 0x030300F0
150 #undef CYTHON_USE_UNICODE_WRITER
151 #define CYTHON_USE_UNICODE_WRITER 0
152 #elif !defined(CYTHON_USE_UNICODE_WRITER)
153 #define CYTHON_USE_UNICODE_WRITER 1
155 #ifndef CYTHON_AVOID_BORROWED_REFS
156 #define CYTHON_AVOID_BORROWED_REFS 0
158 #ifndef CYTHON_ASSUME_SAFE_MACROS
159 #define CYTHON_ASSUME_SAFE_MACROS 1
161 #ifndef CYTHON_UNPACK_METHODS
162 #define CYTHON_UNPACK_METHODS 1
164 #ifndef CYTHON_FAST_THREAD_STATE
165 #define CYTHON_FAST_THREAD_STATE 1
167 #ifndef CYTHON_FAST_PYCALL
168 #define CYTHON_FAST_PYCALL 1
170 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
171 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
173 #ifndef CYTHON_USE_TP_FINALIZE
174 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
177 #if !defined(CYTHON_FAST_PYCCALL)
178 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
180 #if CYTHON_USE_PYLONG_INTERNALS
181 #include "longintrepr.h"
186 #ifndef __has_attribute
187 #define __has_attribute(x) 0
189 #ifndef __has_cpp_attribute
190 #define __has_cpp_attribute(x) 0
192 #ifndef CYTHON_RESTRICT
193 #if defined(__GNUC__)
194 #define CYTHON_RESTRICT __restrict__
195 #elif defined(_MSC_VER) && _MSC_VER >= 1400
196 #define CYTHON_RESTRICT __restrict
197 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
198 #define CYTHON_RESTRICT restrict
200 #define CYTHON_RESTRICT
203 #ifndef CYTHON_UNUSED
204 # if defined(__GNUC__)
205 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
206 # define CYTHON_UNUSED __attribute__ ((__unused__))
208 # define CYTHON_UNUSED
210 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
211 # define CYTHON_UNUSED __attribute__ ((__unused__))
213 # define CYTHON_UNUSED
216 #ifndef CYTHON_MAYBE_UNUSED_VAR
217 # if defined(__cplusplus)
218 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
220 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
223 #ifndef CYTHON_NCP_UNUSED
224 # if CYTHON_COMPILING_IN_CPYTHON
225 # define CYTHON_NCP_UNUSED
227 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
230 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
232 #ifndef _MSC_STDINT_H_
234 typedef unsigned char uint8_t;
235 typedef unsigned int uint32_t;
237 typedef unsigned __int8 uint8_t;
238 typedef unsigned __int32 uint32_t;
244 #ifndef CYTHON_FALLTHROUGH
245 #if defined(__cplusplus) && __cplusplus >= 201103L
246 #if __has_cpp_attribute(fallthrough)
247 #define CYTHON_FALLTHROUGH [[fallthrough]]
248 #elif __has_cpp_attribute(clang::fallthrough)
249 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
250 #elif __has_cpp_attribute(gnu::fallthrough)
251 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
254 #ifndef CYTHON_FALLTHROUGH
255 #if __has_attribute(fallthrough)
256 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
258 #define CYTHON_FALLTHROUGH
261 #if defined(__clang__ ) && defined(__apple_build_version__)
262 #if __apple_build_version__ < 7000000
263 #undef CYTHON_FALLTHROUGH
264 #define CYTHON_FALLTHROUGH
269 #ifndef CYTHON_INLINE
270 #if defined(__clang__)
271 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
272 #elif defined(__GNUC__)
273 #define CYTHON_INLINE __inline__
274 #elif defined(_MSC_VER)
275 #define CYTHON_INLINE __inline
276 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
277 #define CYTHON_INLINE inline
279 #define CYTHON_INLINE
283 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
284 #define Py_OptimizeFlag 0
286 #define __PYX_BUILD_PY_SSIZE_T "n"
287 #define CYTHON_FORMAT_SSIZE_T "z"
288 #if PY_MAJOR_VERSION < 3
289 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
290 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
291 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
292 #define __Pyx_DefaultClassType PyClass_Type
294 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
295 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
296 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
297 #define __Pyx_DefaultClassType PyType_Type
299 #ifndef Py_TPFLAGS_CHECKTYPES
300 #define Py_TPFLAGS_CHECKTYPES 0
302 #ifndef Py_TPFLAGS_HAVE_INDEX
303 #define Py_TPFLAGS_HAVE_INDEX 0
305 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
306 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
308 #ifndef Py_TPFLAGS_HAVE_FINALIZE
309 #define Py_TPFLAGS_HAVE_FINALIZE 0
311 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
312 #ifndef METH_FASTCALL
313 #define METH_FASTCALL 0x80
315 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
316 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
317 Py_ssize_t nargs, PyObject *kwnames);
319 #define __Pyx_PyCFunctionFast _PyCFunctionFast
320 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
322 #if CYTHON_FAST_PYCCALL
323 #define __Pyx_PyFastCFunction_Check(func)\
324 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
326 #define __Pyx_PyFastCFunction_Check(func) 0
328 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
329 #define PyObject_Malloc(s) PyMem_Malloc(s)
330 #define PyObject_Free(p) PyMem_Free(p)
331 #define PyObject_Realloc(p) PyMem_Realloc(p)
333 #if CYTHON_COMPILING_IN_PYSTON
334 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
335 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
337 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
338 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
340 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
341 #define __Pyx_PyThreadState_Current PyThreadState_GET()
342 #elif PY_VERSION_HEX >= 0x03060000
343 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
344 #elif PY_VERSION_HEX >= 0x03000000
345 #define __Pyx_PyThreadState_Current PyThreadState_GET()
347 #define __Pyx_PyThreadState_Current _PyThreadState_Current
349 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
350 #include "pythread.h"
351 #define Py_tss_NEEDS_INIT 0
352 typedef int Py_tss_t;
353 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
354 *key = PyThread_create_key();
357 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
358 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
359 *key = Py_tss_NEEDS_INIT;
362 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
365 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
366 return *key != Py_tss_NEEDS_INIT;
368 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
369 PyThread_delete_key(*key);
370 *key = Py_tss_NEEDS_INIT;
372 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
373 return PyThread_set_key_value(*key, value);
375 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
376 return PyThread_get_key_value(*key);
378 #endif // TSS (Thread Specific Storage) API
379 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
380 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
382 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
384 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
385 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
386 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
388 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
389 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
391 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
392 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
394 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
396 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
397 #define CYTHON_PEP393_ENABLED 1
398 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
399 0 : _PyUnicode_Ready((PyObject *)(op)))
400 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
401 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
402 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
403 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
404 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
405 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
406 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
407 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
409 #define CYTHON_PEP393_ENABLED 0
410 #define PyUnicode_1BYTE_KIND 1
411 #define PyUnicode_2BYTE_KIND 2
412 #define PyUnicode_4BYTE_KIND 4
413 #define __Pyx_PyUnicode_READY(op) (0)
414 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
415 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
416 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
417 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
418 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
419 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
420 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
421 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
423 #if CYTHON_COMPILING_IN_PYPY
424 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
425 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
427 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
428 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
429 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
431 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
432 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
434 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
435 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
437 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
438 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
440 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
441 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
442 #if PY_MAJOR_VERSION >= 3
443 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
445 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
447 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
448 #define PyObject_ASCII(o) PyObject_Repr(o)
450 #if PY_MAJOR_VERSION >= 3
451 #define PyBaseString_Type PyUnicode_Type
452 #define PyStringObject PyUnicodeObject
453 #define PyString_Type PyUnicode_Type
454 #define PyString_Check PyUnicode_Check
455 #define PyString_CheckExact PyUnicode_CheckExact
456 #define PyObject_Unicode PyObject_Str
458 #if PY_MAJOR_VERSION >= 3
459 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
460 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
462 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
463 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
465 #ifndef PySet_CheckExact
466 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
468 #if CYTHON_ASSUME_SAFE_MACROS
469 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
471 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
473 #if PY_MAJOR_VERSION >= 3
474 #define PyIntObject PyLongObject
475 #define PyInt_Type PyLong_Type
476 #define PyInt_Check(op) PyLong_Check(op)
477 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
478 #define PyInt_FromString PyLong_FromString
479 #define PyInt_FromUnicode PyLong_FromUnicode
480 #define PyInt_FromLong PyLong_FromLong
481 #define PyInt_FromSize_t PyLong_FromSize_t
482 #define PyInt_FromSsize_t PyLong_FromSsize_t
483 #define PyInt_AsLong PyLong_AsLong
484 #define PyInt_AS_LONG PyLong_AS_LONG
485 #define PyInt_AsSsize_t PyLong_AsSsize_t
486 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
487 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
488 #define PyNumber_Int PyNumber_Long
490 #if PY_MAJOR_VERSION >= 3
491 #define PyBoolObject PyLongObject
493 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
494 #ifndef PyUnicode_InternFromString
495 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
498 #if PY_VERSION_HEX < 0x030200A4
499 typedef long Py_hash_t;
500 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
501 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
503 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
504 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
506 #if PY_MAJOR_VERSION >= 3
507 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
509 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
511 #if CYTHON_USE_ASYNC_SLOTS
512 #if PY_VERSION_HEX >= 0x030500B1
513 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
514 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
516 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
519 #define __Pyx_PyType_AsAsync(obj) NULL
521 #ifndef __Pyx_PyAsyncMethodsStruct
526 } __Pyx_PyAsyncMethodsStruct;
529 #if defined(WIN32) || defined(MS_WINDOWS)
530 #define _USE_MATH_DEFINES
534 #define __PYX_NAN() ((float) NAN)
536 static CYTHON_INLINE
float __PYX_NAN() {
538 memset(&value, 0xFF,
sizeof(value));
542 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
543 #define __Pyx_truncl trunc
545 #define __Pyx_truncl truncl
549 #define __PYX_ERR(f_index, lineno, Ln_error) \
551 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
554 #ifndef __PYX_EXTERN_C
556 #define __PYX_EXTERN_C extern "C"
558 #define __PYX_EXTERN_C extern
562 #define __PYX_HAVE__csmoothers
563 #define __PYX_HAVE_API__csmoothers
567 #include "numpy/arrayobject.h"
568 #include "numpy/ufuncobject.h"
571 #include "pythread.h"
578 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
579 #define CYTHON_WITHOUT_ASSERTIONS
582 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
583 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
585 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
586 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
587 #define __PYX_DEFAULT_STRING_ENCODING ""
588 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
589 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
590 #define __Pyx_uchar_cast(c) ((unsigned char)c)
591 #define __Pyx_long_cast(x) ((long)x)
592 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
593 (sizeof(type) < sizeof(Py_ssize_t)) ||\
594 (sizeof(type) > sizeof(Py_ssize_t) &&\
595 likely(v < (type)PY_SSIZE_T_MAX ||\
596 v == (type)PY_SSIZE_T_MAX) &&\
597 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
598 v == (type)PY_SSIZE_T_MIN))) ||\
599 (sizeof(type) == sizeof(Py_ssize_t) &&\
600 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
601 v == (type)PY_SSIZE_T_MAX))) )
602 #if defined (__cplusplus) && __cplusplus >= 201103L
604 #define __Pyx_sst_abs(value) std::abs(value)
605 #elif SIZEOF_INT >= SIZEOF_SIZE_T
606 #define __Pyx_sst_abs(value) abs(value)
607 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
608 #define __Pyx_sst_abs(value) labs(value)
609 #elif defined (_MSC_VER)
610 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
611 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
612 #define __Pyx_sst_abs(value) llabs(value)
613 #elif defined (__GNUC__)
614 #define __Pyx_sst_abs(value) __builtin_llabs(value)
616 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
618 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
619 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
620 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
621 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
622 #define __Pyx_PyBytes_FromString PyBytes_FromString
623 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
624 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
625 #if PY_MAJOR_VERSION < 3
626 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
627 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
629 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
630 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
632 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
635 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
636 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
637 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
638 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
639 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
640 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
641 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
642 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
643 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
644 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
645 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
646 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
647 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
648 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
649 const Py_UNICODE *u_end =
u;
651 return (
size_t)(u_end -
u - 1);
653 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
654 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
655 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
656 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
657 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
658 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
659 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
660 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
661 #define __Pyx_PySequence_Tuple(obj)\
662 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
663 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
664 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
665 #if CYTHON_ASSUME_SAFE_MACROS
666 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
668 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
670 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
671 #if PY_MAJOR_VERSION >= 3
672 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
674 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
676 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
677 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
678 static int __Pyx_sys_getdefaultencoding_not_ascii;
679 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
681 PyObject* default_encoding = NULL;
682 PyObject* ascii_chars_u = NULL;
683 PyObject* ascii_chars_b = NULL;
684 const char* default_encoding_c;
685 sys = PyImport_ImportModule(
"sys");
687 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
689 if (!default_encoding)
goto bad;
690 default_encoding_c = PyBytes_AsString(default_encoding);
691 if (!default_encoding_c)
goto bad;
692 if (strcmp(default_encoding_c,
"ascii") == 0) {
693 __Pyx_sys_getdefaultencoding_not_ascii = 0;
695 char ascii_chars[128];
697 for (
c = 0;
c < 128;
c++) {
700 __Pyx_sys_getdefaultencoding_not_ascii = 1;
701 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
702 if (!ascii_chars_u)
goto bad;
703 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
704 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
707 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
711 Py_DECREF(ascii_chars_u);
712 Py_DECREF(ascii_chars_b);
714 Py_DECREF(default_encoding);
717 Py_XDECREF(default_encoding);
718 Py_XDECREF(ascii_chars_u);
719 Py_XDECREF(ascii_chars_b);
723 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
724 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
726 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
727 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
728 static char* __PYX_DEFAULT_STRING_ENCODING;
729 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
731 PyObject* default_encoding = NULL;
732 char* default_encoding_c;
733 sys = PyImport_ImportModule(
"sys");
735 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
737 if (!default_encoding)
goto bad;
738 default_encoding_c = PyBytes_AsString(default_encoding);
739 if (!default_encoding_c)
goto bad;
740 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c));
741 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
742 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
743 Py_DECREF(default_encoding);
746 Py_XDECREF(default_encoding);
754 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
755 #define likely(x) __builtin_expect(!!(x), 1)
756 #define unlikely(x) __builtin_expect(!!(x), 0)
758 #define likely(x) (x)
759 #define unlikely(x) (x)
761 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
763 static PyObject *__pyx_m = NULL;
764 static PyObject *__pyx_d;
765 static PyObject *__pyx_b;
766 static PyObject *__pyx_cython_runtime = NULL;
767 static PyObject *__pyx_empty_tuple;
768 static PyObject *__pyx_empty_bytes;
769 static PyObject *__pyx_empty_unicode;
770 static int __pyx_lineno;
771 static int __pyx_clineno = 0;
772 static const char * __pyx_cfilenm= __FILE__;
773 static const char *__pyx_filename;
776 #if !defined(CYTHON_CCOMPLEX)
777 #if defined(__cplusplus)
778 #define CYTHON_CCOMPLEX 1
779 #elif defined(_Complex_I)
780 #define CYTHON_CCOMPLEX 1
782 #define CYTHON_CCOMPLEX 0
792 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
794 #define _Complex_I 1.0fj
798 static const char *__pyx_f[] = {
799 "proteus/csmoothers.pyx",
801 "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd",
802 "linux2/lib/python2.7/site-packages/Cython/Includes/cpython/type.pxd",
803 "proteus/superluWrappers.pxd",
806 struct __pyx_memoryview_obj;
808 struct __pyx_memoryview_obj *memview;
811 Py_ssize_t strides[8];
812 Py_ssize_t suboffsets[8];
813 } __Pyx_memviewslice;
814 #define __Pyx_MemoryView_Len(m) (m.shape[0])
817 #include <pythread.h>
818 #ifndef CYTHON_ATOMICS
819 #define CYTHON_ATOMICS 1
821 #define __pyx_atomic_int_type int
822 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
823 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
825 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
826 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
827 #ifdef __PYX_DEBUG_ATOMICS
828 #warning "Using GNU atomics"
830 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
832 #undef __pyx_atomic_int_type
833 #define __pyx_atomic_int_type LONG
834 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
835 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
836 #ifdef __PYX_DEBUG_ATOMICS
837 #pragma message ("Using MSVC atomics")
839 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
840 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
841 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
842 #ifdef __PYX_DEBUG_ATOMICS
843 #warning "Using Intel atomics"
846 #undef CYTHON_ATOMICS
847 #define CYTHON_ATOMICS 0
848 #ifdef __PYX_DEBUG_ATOMICS
849 #warning "Not using atomics"
852 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
854 #define __pyx_add_acquisition_count(memview)\
855 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
856 #define __pyx_sub_acquisition_count(memview)\
857 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
859 #define __pyx_add_acquisition_count(memview)\
860 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
861 #define __pyx_sub_acquisition_count(memview)\
862 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
866 #ifndef __PYX_FORCE_INIT_THREADS
867 #define __PYX_FORCE_INIT_THREADS 0
871 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
872 #define __Pyx_PyGILState_Release PyGILState_Release
873 #define __Pyx_FastGIL_Remember()
874 #define __Pyx_FastGIL_Forget()
875 #define __Pyx_FastGilFuncInit()
878 #define IS_UNSIGNED(type) (((type) -1) > 0)
879 struct __Pyx_StructField_;
880 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
883 struct __Pyx_StructField_* fields;
891 typedef struct __Pyx_StructField_ {
892 __Pyx_TypeInfo* type;
897 __Pyx_StructField* field;
898 size_t parent_offset;
899 } __Pyx_BufFmt_StackElem;
901 __Pyx_StructField root;
902 __Pyx_BufFmt_StackElem* head;
904 size_t new_count, enc_count;
905 size_t struct_alignment;
911 } __Pyx_BufFmt_Context;
921 typedef npy_int8 __pyx_t_5numpy_int8_t;
930 typedef npy_int16 __pyx_t_5numpy_int16_t;
939 typedef npy_int32 __pyx_t_5numpy_int32_t;
948 typedef npy_int64 __pyx_t_5numpy_int64_t;
957 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
966 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
975 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
984 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
993 typedef npy_float32 __pyx_t_5numpy_float32_t;
1002 typedef npy_float64 __pyx_t_5numpy_float64_t;
1011 typedef npy_long __pyx_t_5numpy_int_t;
1020 typedef npy_longlong __pyx_t_5numpy_long_t;
1029 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1038 typedef npy_ulong __pyx_t_5numpy_uint_t;
1047 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1056 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1065 typedef npy_intp __pyx_t_5numpy_intp_t;
1074 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1083 typedef npy_double __pyx_t_5numpy_float_t;
1092 typedef npy_double __pyx_t_5numpy_double_t;
1101 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1110 typedef int __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER;
1114 typedef ::std::complex< float > __pyx_t_float_complex;
1116 typedef float _Complex __pyx_t_float_complex;
1119 typedef struct {
float real, imag; } __pyx_t_float_complex;
1121 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1126 typedef ::std::complex< double > __pyx_t_double_complex;
1128 typedef double _Complex __pyx_t_double_complex;
1131 typedef struct {
double real, imag; } __pyx_t_double_complex;
1133 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1137 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix;
1138 struct __pyx_obj_10csmoothers_cASMFactor;
1139 struct __pyx_obj_10csmoothers_cBASMFactor;
1140 struct __pyx_array_obj;
1141 struct __pyx_MemviewEnum_obj;
1142 struct __pyx_memoryview_obj;
1143 struct __pyx_memoryviewslice_obj;
1152 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1161 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1170 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1179 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1180 struct __pyx_t_7proteus_15superluWrappers__NRformat;
1189 struct __pyx_t_7proteus_15superluWrappers__NRformat {
1190 __pyx_t_5numpy_int32_t
nnz;
1191 __pyx_t_5numpy_float64_t *nzval;
1192 __pyx_t_5numpy_int32_t *colind;
1193 __pyx_t_5numpy_int32_t *rowptr;
1203 typedef __Pyx_memviewslice __pyx_t_10csmoothers_DDATA;
1212 typedef __Pyx_memviewslice __pyx_t_10csmoothers_IDATA;
1221 typedef SuperMatrix __pyx_t_10csmoothers_SuperMatrix;
1230 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix {
1232 __pyx_t_5numpy_int32_t dim[2];
1233 struct __pyx_t_7proteus_15superluWrappers__NRformat A;
1244 struct __pyx_obj_10csmoothers_cASMFactor {
1249 double **subdomain_L;
1250 double **subdomain_R;
1251 double **subdomain_dX;
1252 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1263 struct __pyx_obj_10csmoothers_cBASMFactor {
1269 double **subdomain_L;
1270 double **subdomain_R;
1271 double **subdomain_dX;
1272 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1273 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_col_pivots;
1284 struct __pyx_array_obj {
1286 struct __pyx_vtabstruct_array *__pyx_vtab;
1292 Py_ssize_t *_strides;
1293 Py_ssize_t itemsize;
1296 void (*callback_free_data)(
void *);
1298 int dtype_is_object;
1309 struct __pyx_MemviewEnum_obj {
1322 struct __pyx_memoryview_obj {
1324 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1327 PyObject *_array_interface;
1328 PyThread_type_lock lock;
1329 __pyx_atomic_int acquisition_count[2];
1330 __pyx_atomic_int *acquisition_count_aligned_p;
1333 int dtype_is_object;
1334 __Pyx_TypeInfo *typeinfo;
1345 struct __pyx_memoryviewslice_obj {
1346 struct __pyx_memoryview_obj __pyx_base;
1347 __Pyx_memviewslice from_slice;
1348 PyObject *from_object;
1349 PyObject *(*to_object_func)(
char *);
1350 int (*to_dtype_func)(
char *, PyObject *);
1363 struct __pyx_vtabstruct_array {
1364 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1366 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1377 struct __pyx_vtabstruct_memoryview {
1378 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1379 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1380 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1381 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1382 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1383 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1384 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1386 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1397 struct __pyx_vtabstruct__memoryviewslice {
1398 struct __pyx_vtabstruct_memoryview __pyx_base;
1400 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1404 #ifndef CYTHON_REFNANNY
1405 #define CYTHON_REFNANNY 0
1409 void (*INCREF)(
void*, PyObject*, int);
1410 void (*DECREF)(
void*, PyObject*, int);
1411 void (*GOTREF)(
void*, PyObject*, int);
1412 void (*GIVEREF)(
void*, PyObject*, int);
1413 void* (*SetupContext)(
const char*, int,
const char*);
1414 void (*FinishContext)(
void**);
1415 } __Pyx_RefNannyAPIStruct;
1416 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1417 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1418 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1420 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1422 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1423 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1424 PyGILState_Release(__pyx_gilstate_save);\
1426 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1429 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1430 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1432 #define __Pyx_RefNannyFinishContext()\
1433 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1434 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1435 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1436 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1437 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1438 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1439 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1440 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1441 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1443 #define __Pyx_RefNannyDeclarations
1444 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1445 #define __Pyx_RefNannyFinishContext()
1446 #define __Pyx_INCREF(r) Py_INCREF(r)
1447 #define __Pyx_DECREF(r) Py_DECREF(r)
1448 #define __Pyx_GOTREF(r)
1449 #define __Pyx_GIVEREF(r)
1450 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1451 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1452 #define __Pyx_XGOTREF(r)
1453 #define __Pyx_XGIVEREF(r)
1455 #define __Pyx_XDECREF_SET(r, v) do {\
1456 PyObject *tmp = (PyObject *) r;\
1457 r = v; __Pyx_XDECREF(tmp);\
1459 #define __Pyx_DECREF_SET(r, v) do {\
1460 PyObject *tmp = (PyObject *) r;\
1461 r = v; __Pyx_DECREF(tmp);\
1463 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1464 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1467 #if CYTHON_USE_TYPE_SLOTS
1468 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1470 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1474 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1477 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1478 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1481 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1484 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1485 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1486 const char* function_name);
1489 #if CYTHON_USE_TYPE_SLOTS
1490 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1491 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1493 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1494 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1498 #if CYTHON_FAST_PYCCALL
1499 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1501 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1505 #if CYTHON_FAST_PYCALL
1506 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1507 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1508 #if 1 || PY_VERSION_HEX < 0x030600B1
1509 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1511 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1516 #if CYTHON_COMPILING_IN_CPYTHON
1517 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1519 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1523 #if CYTHON_COMPILING_IN_CPYTHON
1524 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1528 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1531 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1532 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1533 __Pyx__ArgTypeTest(obj, type, name, exact))
1534 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1537 #if CYTHON_FAST_THREAD_STATE
1538 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1539 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1540 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1542 #define __Pyx_PyThreadState_declare
1543 #define __Pyx_PyThreadState_assign
1544 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1548 #if CYTHON_FAST_THREAD_STATE
1549 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1550 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1551 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1552 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1553 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1554 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1555 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1556 #if CYTHON_COMPILING_IN_CPYTHON
1557 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1559 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1562 #define __Pyx_PyErr_Clear() PyErr_Clear()
1563 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1564 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1565 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1566 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1567 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1568 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1569 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1573 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1576 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1579 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1580 #define __Pyx_MEMVIEW_DIRECT 1
1581 #define __Pyx_MEMVIEW_PTR 2
1582 #define __Pyx_MEMVIEW_FULL 4
1583 #define __Pyx_MEMVIEW_CONTIG 8
1584 #define __Pyx_MEMVIEW_STRIDED 16
1585 #define __Pyx_MEMVIEW_FOLLOW 32
1586 #define __Pyx_IS_C_CONTIG 1
1587 #define __Pyx_IS_F_CONTIG 2
1588 static int __Pyx_init_memviewslice(
1589 struct __pyx_memoryview_obj *memview,
1591 __Pyx_memviewslice *memviewslice,
1592 int memview_is_new_reference);
1593 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1594 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1595 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1596 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1597 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1598 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1599 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1600 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1601 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1602 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1605 static void __Pyx_RaiseBufferIndexError(
int axis);
1608 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1609 int lineno,
const char *filename,
1610 int full_traceback,
int nogil);
1613 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1614 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1615 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1616 (likely(PyDict_CheckExact(obj)) ?\
1617 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1619 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1620 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1624 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1627 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1630 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1633 #if CYTHON_FAST_THREAD_STATE
1634 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1635 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1636 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1637 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1639 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1640 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1644 #if CYTHON_FAST_THREAD_STATE
1645 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1646 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1648 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1652 #if CYTHON_FAST_THREAD_STATE
1653 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1654 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1656 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1663 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1666 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1669 #if PY_MAJOR_VERSION >= 3
1670 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1672 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1676 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1679 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1680 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1682 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1683 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
1685 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1688 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1689 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1690 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1691 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1692 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1693 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1694 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1695 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1696 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1697 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1698 int wraparound,
int boundscheck);
1699 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1700 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1701 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1702 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1703 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1704 int wraparound,
int boundscheck);
1705 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1706 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1707 int is_list,
int wraparound,
int boundscheck);
1710 #if CYTHON_USE_TYPE_SLOTS
1711 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1713 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1717 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
1719 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1721 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
1723 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1725 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
1727 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1731 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1732 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1733 const char* encoding,
const char* errors,
1734 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
1737 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1740 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1743 #if CYTHON_FAST_THREAD_STATE
1744 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1745 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1747 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1751 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1754 #if CYTHON_COMPILING_IN_CPYTHON
1755 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1756 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1757 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1758 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1760 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1761 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1762 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1764 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1766 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1768 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1769 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1770 PyListObject*
L = (PyListObject*) list;
1771 Py_ssize_t len = Py_SIZE(list);
1772 if (likely(
L->allocated > len)) {
1774 PyList_SET_ITEM(list, len, x);
1775 Py_SIZE(list) = len+1;
1778 return PyList_Append(list, x);
1781 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1785 #if !CYTHON_COMPILING_IN_PYPY
1786 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace);
1788 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
1789 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1793 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
1794 #if CYTHON_COMPILING_IN_CPYTHON
1795 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
1796 if (unlikely(!none))
1801 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
1806 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1807 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1808 PyListObject*
L = (PyListObject*) list;
1809 Py_ssize_t len = Py_SIZE(list);
1810 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
1812 PyList_SET_ITEM(list, len, x);
1813 Py_SIZE(list) = len+1;
1816 return PyList_Append(list, x);
1819 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1823 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
1826 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
1829 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1832 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
1835 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1836 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1838 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1842 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1843 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1845 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1849 static int __Pyx_setup_reduce(PyObject* type_obj);
1852 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1855 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1858 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1861 #define __Pyx_CyFunction_USED 1
1862 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1863 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1864 #define __Pyx_CYFUNCTION_CCLASS 0x04
1865 #define __Pyx_CyFunction_GetClosure(f)\
1866 (((__pyx_CyFunctionObject *) (f))->func_closure)
1867 #define __Pyx_CyFunction_GetClassObj(f)\
1868 (((__pyx_CyFunctionObject *) (f))->func_classobj)
1869 #define __Pyx_CyFunction_Defaults(type, f)\
1870 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1871 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1872 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1874 PyCFunctionObject func;
1875 #if PY_VERSION_HEX < 0x030500A0
1876 PyObject *func_weakreflist;
1878 PyObject *func_dict;
1879 PyObject *func_name;
1880 PyObject *func_qualname;
1882 PyObject *func_globals;
1883 PyObject *func_code;
1884 PyObject *func_closure;
1885 PyObject *func_classobj;
1887 int defaults_pyobjects;
1889 PyObject *defaults_tuple;
1890 PyObject *defaults_kwdict;
1891 PyObject *(*defaults_getter)(PyObject *);
1892 PyObject *func_annotations;
1893 } __pyx_CyFunctionObject;
1894 static PyTypeObject *__pyx_CyFunctionType = 0;
1895 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
1896 __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
1897 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
1898 int flags, PyObject* qualname,
1900 PyObject *module, PyObject *globals,
1902 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1905 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1907 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1909 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1911 static int __pyx_CyFunction_init(
void);
1914 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1915 #define __Pyx_SetNameInClass(ns, name, value)\
1916 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1917 #elif CYTHON_COMPILING_IN_CPYTHON
1918 #define __Pyx_SetNameInClass(ns, name, value)\
1919 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
1921 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
1925 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
1926 PyObject *mkw, PyObject *modname, PyObject *doc);
1927 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
1928 PyObject *mkw,
int calculate_metaclass,
int allow_py2_metaclass);
1931 #ifdef CYTHON_CLINE_IN_TRACEBACK
1932 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1934 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1939 PyCodeObject* code_object;
1941 } __Pyx_CodeObjectCacheEntry;
1942 struct __Pyx_CodeObjectCache {
1945 __Pyx_CodeObjectCacheEntry* entries;
1947 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1948 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1949 static PyCodeObject *__pyx_find_code_object(
int code_line);
1950 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1953 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1954 int py_line,
const char *filename);
1956 #if PY_MAJOR_VERSION < 3
1957 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
1958 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1960 #define __Pyx_GetBuffer PyObject_GetBuffer
1961 #define __Pyx_ReleaseBuffer PyBuffer_Release
1967 Py_ssize_t shape, strides, suboffsets;
1968 } __Pyx_Buf_DimInfo;
1974 __Pyx_Buffer *rcbuffer;
1976 __Pyx_Buf_DimInfo diminfo[8];
1977 } __Pyx_LocalBuf_ND;
1980 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
1983 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
1984 __Pyx_memviewslice *slice2,
1985 int ndim,
size_t itemsize);
1988 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
1993 #define __Pyx_CREAL(z) ((z).real())
1994 #define __Pyx_CIMAG(z) ((z).imag())
1996 #define __Pyx_CREAL(z) (__real__(z))
1997 #define __Pyx_CIMAG(z) (__imag__(z))
2000 #define __Pyx_CREAL(z) ((z).real)
2001 #define __Pyx_CIMAG(z) ((z).imag)
2003 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2004 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2005 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2006 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2008 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2009 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2014 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2015 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2016 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2017 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2018 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2019 #define __Pyx_c_neg_float(a) (-(a))
2021 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2022 #define __Pyx_c_conj_float(z) (::std::conj(z))
2024 #define __Pyx_c_abs_float(z) (::std::abs(z))
2025 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2028 #define __Pyx_c_is_zero_float(z) ((z)==0)
2029 #define __Pyx_c_conj_float(z) (conjf(z))
2031 #define __Pyx_c_abs_float(z) (cabsf(z))
2032 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2036 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2037 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2038 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2039 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2040 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2041 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2042 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2043 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2045 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2046 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2052 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2053 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2054 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2055 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2056 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2057 #define __Pyx_c_neg_double(a) (-(a))
2059 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2060 #define __Pyx_c_conj_double(z) (::std::conj(z))
2062 #define __Pyx_c_abs_double(z) (::std::abs(z))
2063 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2066 #define __Pyx_c_is_zero_double(z) ((z)==0)
2067 #define __Pyx_c_conj_double(z) (conj(z))
2069 #define __Pyx_c_abs_double(z) (cabs(z))
2070 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2074 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2075 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2076 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2077 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2078 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2079 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2080 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2081 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2083 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2084 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2089 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2092 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value);
2095 static __Pyx_memviewslice
2096 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2097 const char *mode,
int ndim,
2098 size_t sizeof_dtype,
int contig_flag,
2099 int dtype_is_object);
2102 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2105 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2108 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2111 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2114 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2117 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2118 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2119 __Pyx_BufFmt_StackElem* stack,
2120 __Pyx_TypeInfo* type);
2123 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2126 static int __Pyx_ValidateAndInit_memviewslice(
2131 __Pyx_TypeInfo *dtype,
2132 __Pyx_BufFmt_StackElem stack[],
2133 __Pyx_memviewslice *memviewslice,
2134 PyObject *original_obj);
2137 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2140 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *,
int writable_flag);
2143 static int __Pyx_check_binary_version(
void);
2146 #if !defined(__Pyx_PyIdentifier_FromString)
2147 #if PY_MAJOR_VERSION < 3
2148 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
2150 #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
2155 static PyObject *__Pyx_ImportModule(
const char *name);
2158 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
size_t size,
int strict);
2161 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2163 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2164 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2165 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2166 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2167 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2168 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2169 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2170 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2171 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2172 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2185 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2198 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2199 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2200 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2201 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2202 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2203 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *,
char *,
char *,
int *);
2206 static PyTypeObject *__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = 0;
2213 static PyTypeObject *__pyx_ptype_10csmoothers_cASMFactor = 0;
2214 static PyTypeObject *__pyx_ptype_10csmoothers_cBASMFactor = 0;
2215 static PyTypeObject *__pyx_array_type = 0;
2216 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2217 static PyTypeObject *__pyx_memoryview_type = 0;
2218 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2219 static PyObject *
generic = 0;
2220 static PyObject *strided = 0;
2221 static PyObject *indirect = 0;
2222 static PyObject *contiguous = 0;
2223 static PyObject *indirect_contiguous = 0;
2224 static int __pyx_memoryview_thread_locks_used;
2225 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2226 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
double, __pyx_t_10csmoothers_DDATA);
2227 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA);
2228 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA,
double,
double, __pyx_t_10csmoothers_DDATA);
2229 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
double, __pyx_t_10csmoothers_DDATA);
2230 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA);
2231 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA,
double,
double, __pyx_t_10csmoothers_DDATA);
2232 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
struct __pyx_obj_10csmoothers_cASMFactor *);
2233 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
struct __pyx_obj_10csmoothers_cASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA);
2234 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
struct __pyx_obj_10csmoothers_cBASMFactor *);
2235 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
struct __pyx_obj_10csmoothers_cBASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA);
2236 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2237 static void *__pyx_align_pointer(
void *,
size_t);
2238 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2239 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2240 static PyObject *_unellipsify(PyObject *,
int);
2241 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2242 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2243 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2244 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2245 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2246 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2247 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2248 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2249 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2250 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2251 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2252 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2253 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2254 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2255 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2256 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2257 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2258 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2259 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2260 static int __pyx_memoryview_err(PyObject *,
char *);
2261 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2262 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2263 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2264 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2265 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2266 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2267 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2268 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2269 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2270 static __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, IS_UNSIGNED(
int) ?
'U' :
'I', IS_UNSIGNED(
int), 0 };
2271 #define __Pyx_MODULE_NAME "csmoothers"
2272 extern int __pyx_module_is_main_csmoothers;
2273 int __pyx_module_is_main_csmoothers = 0;
2276 static PyObject *__pyx_builtin_object;
2277 static PyObject *__pyx_builtin_TypeError;
2278 static PyObject *__pyx_builtin_ValueError;
2279 static PyObject *__pyx_builtin_range;
2280 static PyObject *__pyx_builtin_RuntimeError;
2281 static PyObject *__pyx_builtin_ImportError;
2282 static PyObject *__pyx_builtin_MemoryError;
2283 static PyObject *__pyx_builtin_enumerate;
2284 static PyObject *__pyx_builtin_Ellipsis;
2285 static PyObject *__pyx_builtin_id;
2286 static PyObject *__pyx_builtin_IndexError;
2287 static const char __pyx_k_A[] =
"A";
2288 static const char __pyx_k_L[] =
"L";
2289 static const char __pyx_k_M[] =
"M";
2290 static const char __pyx_k_O[] =
"O";
2291 static const char __pyx_k_R[] =
"R";
2292 static const char __pyx_k_c[] =
"c";
2293 static const char __pyx_k_w[] =
"w";
2294 static const char __pyx_k_bs[] =
"bs";
2295 static const char __pyx_k_dX[] =
"dX";
2296 static const char __pyx_k_id[] =
"id";
2297 static const char __pyx_k_nc[] =
"nc";
2298 static const char __pyx_k_np[] =
"np";
2299 static const char __pyx_k_nr[] =
"nr";
2300 static const char __pyx_k_doc[] =
"__doc__";
2301 static const char __pyx_k_new[] =
"__new__";
2302 static const char __pyx_k_obj[] =
"obj";
2303 static const char __pyx_k_tol[] =
"tol";
2304 static const char __pyx_k_base[] =
"base";
2305 static const char __pyx_k_dict[] =
"__dict__";
2306 static const char __pyx_k_init[] =
"__init__";
2307 static const char __pyx_k_main[] =
"__main__";
2308 static const char __pyx_k_mode[] =
"mode";
2309 static const char __pyx_k_name[] =
"name";
2310 static const char __pyx_k_ndim[] =
"ndim";
2311 static const char __pyx_k_pack[] =
"pack";
2312 static const char __pyx_k_self[] =
"self";
2313 static const char __pyx_k_size[] =
"size";
2314 static const char __pyx_k_step[] =
"step";
2315 static const char __pyx_k_stop[] =
"stop";
2316 static const char __pyx_k_test[] =
"__test__";
2317 static const char __pyx_k_ASCII[] =
"ASCII";
2318 static const char __pyx_k_class[] =
"__class__";
2319 static const char __pyx_k_error[] =
"error";
2320 static const char __pyx_k_flags[] =
"flags";
2321 static const char __pyx_k_numpy[] =
"numpy";
2322 static const char __pyx_k_range[] =
"range";
2323 static const char __pyx_k_shape[] =
"shape";
2324 static const char __pyx_k_start[] =
"start";
2325 static const char __pyx_k_encode[] =
"encode";
2326 static const char __pyx_k_format[] =
"format";
2327 static const char __pyx_k_import[] =
"__import__";
2328 static const char __pyx_k_module[] =
"__module__";
2329 static const char __pyx_k_name_2[] =
"__name__";
2330 static const char __pyx_k_object[] =
"object";
2331 static const char __pyx_k_pickle[] =
"pickle";
2332 static const char __pyx_k_reduce[] =
"__reduce__";
2333 static const char __pyx_k_struct[] =
"struct";
2334 static const char __pyx_k_unpack[] =
"unpack";
2335 static const char __pyx_k_update[] =
"update";
2336 static const char __pyx_k_fortran[] =
"fortran";
2337 static const char __pyx_k_memview[] =
"memview";
2338 static const char __pyx_k_prepare[] =
"__prepare__";
2339 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2340 static const char __pyx_k_getstate[] =
"__getstate__";
2341 static const char __pyx_k_itemsize[] =
"itemsize";
2342 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2343 static const char __pyx_k_qualname[] =
"__qualname__";
2344 static const char __pyx_k_setstate[] =
"__setstate__";
2345 static const char __pyx_k_ASMFactor[] =
"ASMFactor";
2346 static const char __pyx_k_TypeError[] =
"TypeError";
2347 static const char __pyx_k_asmFactor[] =
"asmFactor";
2348 static const char __pyx_k_enumerate[] =
"enumerate";
2349 static const char __pyx_k_metaclass[] =
"__metaclass__";
2350 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2351 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2352 static const char __pyx_k_BASMFactor[] =
"BASMFactor";
2353 static const char __pyx_k_IndexError[] =
"IndexError";
2354 static const char __pyx_k_ValueError[] =
"ValueError";
2355 static const char __pyx_k_basmFactor[] =
"basmFactor";
2356 static const char __pyx_k_cASMFactor[] =
"_cASMFactor";
2357 static const char __pyx_k_csmoothers[] =
"csmoothers";
2358 static const char __pyx_k_node_order[] =
"node_order";
2359 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2360 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2361 static const char __pyx_k_ImportError[] =
"ImportError";
2362 static const char __pyx_k_MemoryError[] =
"MemoryError";
2363 static const char __pyx_k_PickleError[] =
"PickleError";
2364 static const char __pyx_k_cBASMFactor[] =
"_cBASMFactor";
2365 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
2366 static const char __pyx_k_asm_NR_solve[] =
"asm_NR_solve";
2367 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2368 static const char __pyx_k_stringsource[] =
"stringsource";
2369 static const char __pyx_k_basm_NR_solve[] =
"basm_NR_solve";
2370 static const char __pyx_k_cSparseMatrix[] =
"_cSparseMatrix";
2371 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2372 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2373 static const char __pyx_k_asm_NR_prepare[] =
"asm_NR_prepare";
2374 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2375 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2376 static const char __pyx_k_basm_NR_prepare[] =
"basm_NR_prepare";
2377 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2378 static const char __pyx_k_jacobi_NR_solve[] =
"jacobi_NR_solve";
2379 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2380 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2381 static const char __pyx_k_ASMFactor___init[] =
"ASMFactor.__init__";
2382 static const char __pyx_k_BASMFactor___init[] =
"BASMFactor.__init__";
2383 static const char __pyx_k_jacobi_NR_prepare[] =
"jacobi_NR_prepare";
2384 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2385 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2386 static const char __pyx_k_nl_jacobi_NR_solve[] =
"nl_jacobi_NR_solve";
2387 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2388 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2389 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2390 static const char __pyx_k_gauss_seidel_NR_solve[] =
"gauss_seidel_NR_solve";
2391 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2392 static const char __pyx_k_gauss_seidel_NR_preare[] =
"gauss_seidel_NR_preare";
2393 static const char __pyx_k_proteus_csmoothers_pyx[] =
"proteus/csmoothers.pyx";
2394 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2395 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2396 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2397 static const char __pyx_k_nl_gauss_seidel_NR_solve[] =
"nl_gauss_seidel_NR_solve";
2398 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2399 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2400 static const char __pyx_k_ndarray_is_not_C_contiguous[] =
"ndarray is not C contiguous";
2401 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2402 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2403 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2404 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] =
"unknown dtype code in numpy.pxd (%d)";
2405 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2406 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2407 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2408 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2409 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2410 static const char __pyx_k_Format_string_allocated_too_shor[] =
"Format string allocated too short, see comment in numpy.pxd";
2411 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] =
"Incompatible checksums (%s vs 0xb068931 = (name))";
2412 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2413 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2414 static const char __pyx_k_Non_native_byte_order_not_suppor[] =
"Non-native byte order not supported";
2415 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2416 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2417 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2418 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] =
"ndarray is not Fortran contiguous";
2419 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2420 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2421 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2422 static const char __pyx_k_Format_string_allocated_too_shor_2[] =
"Format string allocated too short.";
2423 static PyObject *__pyx_n_s_A;
2424 static PyObject *__pyx_n_s_ASCII;
2425 static PyObject *__pyx_n_s_ASMFactor;
2426 static PyObject *__pyx_n_s_ASMFactor___init;
2427 static PyObject *__pyx_n_s_BASMFactor;
2428 static PyObject *__pyx_n_s_BASMFactor___init;
2429 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2430 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2431 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2432 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2433 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2434 static PyObject *__pyx_n_s_Ellipsis;
2435 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2436 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2437 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2438 static PyObject *__pyx_n_s_ImportError;
2439 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2440 static PyObject *__pyx_n_s_IndexError;
2441 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2442 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2443 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2444 static PyObject *__pyx_n_s_L;
2445 static PyObject *__pyx_n_s_M;
2446 static PyObject *__pyx_n_s_MemoryError;
2447 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2448 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2449 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2450 static PyObject *__pyx_n_b_O;
2451 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2452 static PyObject *__pyx_n_s_PickleError;
2453 static PyObject *__pyx_n_s_R;
2454 static PyObject *__pyx_n_s_RuntimeError;
2455 static PyObject *__pyx_n_s_TypeError;
2456 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2457 static PyObject *__pyx_n_s_ValueError;
2458 static PyObject *__pyx_n_s_View_MemoryView;
2459 static PyObject *__pyx_n_s_allocate_buffer;
2460 static PyObject *__pyx_n_s_asmFactor;
2461 static PyObject *__pyx_n_s_asm_NR_prepare;
2462 static PyObject *__pyx_n_s_asm_NR_solve;
2463 static PyObject *__pyx_n_s_base;
2464 static PyObject *__pyx_n_s_basmFactor;
2465 static PyObject *__pyx_n_s_basm_NR_prepare;
2466 static PyObject *__pyx_n_s_basm_NR_solve;
2467 static PyObject *__pyx_n_s_bs;
2468 static PyObject *__pyx_n_s_c;
2469 static PyObject *__pyx_n_u_c;
2470 static PyObject *__pyx_n_s_cASMFactor;
2471 static PyObject *__pyx_n_s_cBASMFactor;
2472 static PyObject *__pyx_n_s_cSparseMatrix;
2473 static PyObject *__pyx_n_s_class;
2474 static PyObject *__pyx_n_s_cline_in_traceback;
2475 static PyObject *__pyx_kp_s_contiguous_and_direct;
2476 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2477 static PyObject *__pyx_n_s_csmoothers;
2478 static PyObject *__pyx_n_s_dX;
2479 static PyObject *__pyx_n_s_dict;
2480 static PyObject *__pyx_n_s_doc;
2481 static PyObject *__pyx_n_s_dtype_is_object;
2482 static PyObject *__pyx_n_s_encode;
2483 static PyObject *__pyx_n_s_enumerate;
2484 static PyObject *__pyx_n_s_error;
2485 static PyObject *__pyx_n_s_flags;
2486 static PyObject *__pyx_n_s_format;
2487 static PyObject *__pyx_n_s_fortran;
2488 static PyObject *__pyx_n_u_fortran;
2489 static PyObject *__pyx_n_s_gauss_seidel_NR_preare;
2490 static PyObject *__pyx_n_s_gauss_seidel_NR_solve;
2491 static PyObject *__pyx_n_s_getstate;
2492 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2493 static PyObject *__pyx_n_s_id;
2494 static PyObject *__pyx_n_s_import;
2495 static PyObject *__pyx_n_s_init;
2496 static PyObject *__pyx_n_s_itemsize;
2497 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2498 static PyObject *__pyx_n_s_jacobi_NR_prepare;
2499 static PyObject *__pyx_n_s_jacobi_NR_solve;
2500 static PyObject *__pyx_n_s_main;
2501 static PyObject *__pyx_n_s_memview;
2502 static PyObject *__pyx_n_s_metaclass;
2503 static PyObject *__pyx_n_s_mode;
2504 static PyObject *__pyx_n_s_module;
2505 static PyObject *__pyx_n_s_name;
2506 static PyObject *__pyx_n_s_name_2;
2507 static PyObject *__pyx_n_s_nc;
2508 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2509 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2510 static PyObject *__pyx_n_s_ndim;
2511 static PyObject *__pyx_n_s_new;
2512 static PyObject *__pyx_n_s_nl_gauss_seidel_NR_solve;
2513 static PyObject *__pyx_n_s_nl_jacobi_NR_solve;
2514 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2515 static PyObject *__pyx_n_s_node_order;
2516 static PyObject *__pyx_n_s_np;
2517 static PyObject *__pyx_n_s_nr;
2518 static PyObject *__pyx_n_s_numpy;
2519 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2520 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2521 static PyObject *__pyx_n_s_obj;
2522 static PyObject *__pyx_n_s_object;
2523 static PyObject *__pyx_n_s_pack;
2524 static PyObject *__pyx_n_s_pickle;
2525 static PyObject *__pyx_n_s_prepare;
2526 static PyObject *__pyx_kp_s_proteus_csmoothers_pyx;
2527 static PyObject *__pyx_n_s_pyx_PickleError;
2528 static PyObject *__pyx_n_s_pyx_checksum;
2529 static PyObject *__pyx_n_s_pyx_getbuffer;
2530 static PyObject *__pyx_n_s_pyx_result;
2531 static PyObject *__pyx_n_s_pyx_state;
2532 static PyObject *__pyx_n_s_pyx_type;
2533 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2534 static PyObject *__pyx_n_s_pyx_vtable;
2535 static PyObject *__pyx_n_s_qualname;
2536 static PyObject *__pyx_n_s_range;
2537 static PyObject *__pyx_n_s_reduce;
2538 static PyObject *__pyx_n_s_reduce_cython;
2539 static PyObject *__pyx_n_s_reduce_ex;
2540 static PyObject *__pyx_n_s_self;
2541 static PyObject *__pyx_n_s_setstate;
2542 static PyObject *__pyx_n_s_setstate_cython;
2543 static PyObject *__pyx_n_s_shape;
2544 static PyObject *__pyx_n_s_size;
2545 static PyObject *__pyx_n_s_start;
2546 static PyObject *__pyx_n_s_step;
2547 static PyObject *__pyx_n_s_stop;
2548 static PyObject *__pyx_kp_s_strided_and_direct;
2549 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2550 static PyObject *__pyx_kp_s_strided_and_indirect;
2551 static PyObject *__pyx_kp_s_stringsource;
2552 static PyObject *__pyx_n_s_struct;
2553 static PyObject *__pyx_n_s_test;
2554 static PyObject *__pyx_n_s_tol;
2555 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2556 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2557 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2558 static PyObject *__pyx_n_s_unpack;
2559 static PyObject *__pyx_n_s_update;
2560 static PyObject *__pyx_n_s_w;
2561 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L);
2562 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L);
2563 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self);
2564 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self);
2565 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2566 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs);
2567 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L,
int __pyx_v_bs);
2568 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self);
2569 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self);
2570 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2571 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M);
2572 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX);
2573 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX);
2574 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M);
2575 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX);
2576 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX);
2577 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor);
2578 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX);
2579 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor);
2580 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX);
2581 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2582 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info);
2583 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2584 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2585 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2586 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2587 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2588 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2589 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2590 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2591 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2592 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2593 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2594 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2595 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2596 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2597 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2598 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2599 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2600 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2601 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2602 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2603 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2604 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2605 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2606 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2607 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2608 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2609 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2610 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2611 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2612 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2613 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2614 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2615 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2616 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2617 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2618 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2619 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2620 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2621 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2622 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2623 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2624 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2625 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k);
2626 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k);
2627 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2628 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2629 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2630 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2631 static PyObject *__pyx_int_0;
2632 static PyObject *__pyx_int_1;
2633 static PyObject *__pyx_int_184977713;
2634 static PyObject *__pyx_int_neg_1;
2635 static PyObject *__pyx_tuple_;
2636 static PyObject *__pyx_tuple__2;
2637 static PyObject *__pyx_tuple__3;
2638 static PyObject *__pyx_tuple__4;
2639 static PyObject *__pyx_tuple__5;
2640 static PyObject *__pyx_tuple__6;
2641 static PyObject *__pyx_tuple__7;
2642 static PyObject *__pyx_tuple__8;
2643 static PyObject *__pyx_tuple__9;
2644 static PyObject *__pyx_slice__29;
2645 static PyObject *__pyx_slice__30;
2646 static PyObject *__pyx_slice__31;
2647 static PyObject *__pyx_tuple__10;
2648 static PyObject *__pyx_tuple__11;
2649 static PyObject *__pyx_tuple__12;
2650 static PyObject *__pyx_tuple__13;
2651 static PyObject *__pyx_tuple__14;
2652 static PyObject *__pyx_tuple__15;
2653 static PyObject *__pyx_tuple__16;
2654 static PyObject *__pyx_tuple__17;
2655 static PyObject *__pyx_tuple__18;
2656 static PyObject *__pyx_tuple__19;
2657 static PyObject *__pyx_tuple__20;
2658 static PyObject *__pyx_tuple__21;
2659 static PyObject *__pyx_tuple__22;
2660 static PyObject *__pyx_tuple__23;
2661 static PyObject *__pyx_tuple__24;
2662 static PyObject *__pyx_tuple__25;
2663 static PyObject *__pyx_tuple__26;
2664 static PyObject *__pyx_tuple__27;
2665 static PyObject *__pyx_tuple__28;
2666 static PyObject *__pyx_tuple__32;
2667 static PyObject *__pyx_tuple__33;
2668 static PyObject *__pyx_tuple__34;
2669 static PyObject *__pyx_tuple__35;
2670 static PyObject *__pyx_tuple__36;
2671 static PyObject *__pyx_tuple__38;
2672 static PyObject *__pyx_tuple__39;
2673 static PyObject *__pyx_tuple__41;
2674 static PyObject *__pyx_tuple__43;
2675 static PyObject *__pyx_tuple__45;
2676 static PyObject *__pyx_tuple__47;
2677 static PyObject *__pyx_tuple__49;
2678 static PyObject *__pyx_tuple__51;
2679 static PyObject *__pyx_tuple__53;
2680 static PyObject *__pyx_tuple__55;
2681 static PyObject *__pyx_tuple__57;
2682 static PyObject *__pyx_tuple__59;
2683 static PyObject *__pyx_tuple__61;
2684 static PyObject *__pyx_tuple__62;
2685 static PyObject *__pyx_tuple__63;
2686 static PyObject *__pyx_tuple__64;
2687 static PyObject *__pyx_tuple__65;
2688 static PyObject *__pyx_tuple__66;
2689 static PyObject *__pyx_codeobj__37;
2690 static PyObject *__pyx_codeobj__40;
2691 static PyObject *__pyx_codeobj__42;
2692 static PyObject *__pyx_codeobj__44;
2693 static PyObject *__pyx_codeobj__46;
2694 static PyObject *__pyx_codeobj__48;
2695 static PyObject *__pyx_codeobj__50;
2696 static PyObject *__pyx_codeobj__52;
2697 static PyObject *__pyx_codeobj__54;
2698 static PyObject *__pyx_codeobj__56;
2699 static PyObject *__pyx_codeobj__58;
2700 static PyObject *__pyx_codeobj__60;
2701 static PyObject *__pyx_codeobj__67;
2713 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2714 static PyMethodDef __pyx_mdef_10csmoothers_9ASMFactor_1__init__ = {
"__init__", (PyCFunction)__pyx_pw_10csmoothers_9ASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2715 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2716 PyObject *__pyx_v_self = 0;
2717 PyObject *__pyx_v_L = 0;
2718 PyObject *__pyx_r = 0;
2719 __Pyx_RefNannyDeclarations
2720 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
2722 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,0};
2723 PyObject* values[2] = {0,0};
2724 if (unlikely(__pyx_kwds)) {
2726 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2728 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2730 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2733 default:
goto __pyx_L5_argtuple_error;
2735 kw_args = PyDict_Size(__pyx_kwds);
2738 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2739 else goto __pyx_L5_argtuple_error;
2742 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2744 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 2, 2, 1); __PYX_ERR(0, 7, __pyx_L3_error)
2747 if (unlikely(kw_args > 0)) {
2748 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 7, __pyx_L3_error)
2750 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2751 goto __pyx_L5_argtuple_error;
2753 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2754 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2756 __pyx_v_self = values[0];
2757 __pyx_v_L = values[1];
2759 goto __pyx_L4_argument_unpacking_done;
2760 __pyx_L5_argtuple_error:;
2761 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7, __pyx_L3_error)
2763 __Pyx_AddTraceback(
"csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2764 __Pyx_RefNannyFinishContext();
2766 __pyx_L4_argument_unpacking_done:;
2767 __pyx_r = __pyx_pf_10csmoothers_9ASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L);
2770 __Pyx_RefNannyFinishContext();
2774 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L) {
2775 PyObject *__pyx_r = NULL;
2776 __Pyx_RefNannyDeclarations
2777 PyObject *__pyx_t_1 = NULL;
2778 PyObject *__pyx_t_2 = NULL;
2779 __Pyx_RefNannySetupContext(
"__init__", 0);
2788 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
2797 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
2798 __Pyx_GOTREF(__pyx_t_1);
2799 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
2800 __Pyx_GOTREF(__pyx_t_2);
2801 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2802 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_10csmoothers_cASMFactor), __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
2803 __Pyx_GOTREF(__pyx_t_1);
2804 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2805 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
2806 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2817 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2820 __Pyx_XDECREF(__pyx_t_1);
2821 __Pyx_XDECREF(__pyx_t_2);
2822 __Pyx_AddTraceback(
"csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2825 __Pyx_XGIVEREF(__pyx_r);
2826 __Pyx_RefNannyFinishContext();
2839 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2840 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2841 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
2843 __Pyx_RefNannyDeclarations
2844 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2846 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,0};
2847 PyObject* values[1] = {0};
2848 if (unlikely(__pyx_kwds)) {
2850 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2852 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2855 default:
goto __pyx_L5_argtuple_error;
2857 kw_args = PyDict_Size(__pyx_kwds);
2860 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2861 else goto __pyx_L5_argtuple_error;
2863 if (unlikely(kw_args > 0)) {
2864 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
2866 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2867 goto __pyx_L5_argtuple_error;
2869 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2871 __pyx_v_L = ((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
2873 goto __pyx_L4_argument_unpacking_done;
2874 __pyx_L5_argtuple_error:;
2875 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
2877 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2878 __Pyx_RefNannyFinishContext();
2880 __pyx_L4_argument_unpacking_done:;
2881 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1,
"L", 0))) __PYX_ERR(0, 14, __pyx_L1_error)
2882 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor___cinit__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), __pyx_v_L);
2889 __Pyx_RefNannyFinishContext();
2893 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L) {
2895 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
2897 __Pyx_RefNannyDeclarations
2898 PyObject *__pyx_t_1 = NULL;
2900 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2918 __pyx_v_AS.Stype = SLU_NR;
2927 __pyx_v_AS.Dtype = SLU_D;
2936 __pyx_v_AS.Mtype = SLU_GE;
2945 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
2946 __Pyx_GOTREF(__pyx_t_1);
2947 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L1_error)
2948 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2949 __pyx_v_AS.nrow = __pyx_t_2;
2958 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
2959 __Pyx_GOTREF(__pyx_t_1);
2960 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error)
2961 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2962 __pyx_v_AS.ncol = __pyx_t_2;
2971 __pyx_v_AS.Store = (&__pyx_v_L->A);
2980 __pyx_v_rval =
asm_NR_init((&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots));
2989 #ifndef CYTHON_WITHOUT_ASSERTIONS
2990 if (unlikely(!Py_OptimizeFlag)) {
2991 if (unlikely(!((__pyx_v_rval == 0) != 0))) {
2992 PyErr_SetNone(PyExc_AssertionError);
2993 __PYX_ERR(0, 30, __pyx_L1_error)
3010 __Pyx_XDECREF(__pyx_t_1);
3011 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3014 __Pyx_RefNannyFinishContext();
3027 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self);
3028 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3029 __Pyx_RefNannyDeclarations
3030 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3031 __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3034 __Pyx_RefNannyFinishContext();
3037 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3038 __Pyx_RefNannyDeclarations
3039 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3048 asm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots);
3059 __Pyx_RefNannyFinishContext();
3069 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3070 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3071 PyObject *__pyx_r = 0;
3072 __Pyx_RefNannyDeclarations
3073 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
3074 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3077 __Pyx_RefNannyFinishContext();
3081 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3082 PyObject *__pyx_r = NULL;
3083 __Pyx_RefNannyDeclarations
3084 PyObject *__pyx_t_1 = NULL;
3085 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
3093 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3094 __Pyx_GOTREF(__pyx_t_1);
3095 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3096 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3097 __PYX_ERR(1, 2, __pyx_L1_error)
3107 __Pyx_XDECREF(__pyx_t_1);
3108 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3110 __Pyx_XGIVEREF(__pyx_r);
3111 __Pyx_RefNannyFinishContext();
3123 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3124 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3125 PyObject *__pyx_r = 0;
3126 __Pyx_RefNannyDeclarations
3127 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
3128 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3131 __Pyx_RefNannyFinishContext();
3135 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3136 PyObject *__pyx_r = NULL;
3137 __Pyx_RefNannyDeclarations
3138 PyObject *__pyx_t_1 = NULL;
3139 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
3146 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3147 __Pyx_GOTREF(__pyx_t_1);
3148 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3149 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3150 __PYX_ERR(1, 4, __pyx_L1_error)
3161 __Pyx_XDECREF(__pyx_t_1);
3162 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3164 __Pyx_XGIVEREF(__pyx_r);
3165 __Pyx_RefNannyFinishContext();
3178 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3179 static PyMethodDef __pyx_mdef_10csmoothers_10BASMFactor_1__init__ = {
"__init__", (PyCFunction)__pyx_pw_10csmoothers_10BASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
3180 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3181 PyObject *__pyx_v_self = 0;
3182 PyObject *__pyx_v_L = 0;
3183 PyObject *__pyx_v_bs = 0;
3184 PyObject *__pyx_r = 0;
3185 __Pyx_RefNannyDeclarations
3186 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
3188 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,&__pyx_n_s_bs,0};
3189 PyObject* values[3] = {0,0,0};
3190 if (unlikely(__pyx_kwds)) {
3192 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3194 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3196 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3198 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3201 default:
goto __pyx_L5_argtuple_error;
3203 kw_args = PyDict_Size(__pyx_kwds);
3206 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3207 else goto __pyx_L5_argtuple_error;
3210 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3212 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, 1); __PYX_ERR(0, 44, __pyx_L3_error)
3216 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3218 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, 2); __PYX_ERR(0, 44, __pyx_L3_error)
3221 if (unlikely(kw_args > 0)) {
3222 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 44, __pyx_L3_error)
3224 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3225 goto __pyx_L5_argtuple_error;
3227 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3228 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3229 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3231 __pyx_v_self = values[0];
3232 __pyx_v_L = values[1];
3233 __pyx_v_bs = values[2];
3235 goto __pyx_L4_argument_unpacking_done;
3236 __pyx_L5_argtuple_error:;
3237 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 44, __pyx_L3_error)
3239 __Pyx_AddTraceback(
"csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3240 __Pyx_RefNannyFinishContext();
3242 __pyx_L4_argument_unpacking_done:;
3243 __pyx_r = __pyx_pf_10csmoothers_10BASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L, __pyx_v_bs);
3246 __Pyx_RefNannyFinishContext();
3250 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs) {
3251 PyObject *__pyx_r = NULL;
3252 __Pyx_RefNannyDeclarations
3253 PyObject *__pyx_t_1 = NULL;
3254 PyObject *__pyx_t_2 = NULL;
3255 PyObject *__pyx_t_3 = NULL;
3256 __Pyx_RefNannySetupContext(
"__init__", 0);
3265 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
3274 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bs, __pyx_v_bs) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
3283 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3284 __Pyx_GOTREF(__pyx_t_1);
3285 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
3286 __Pyx_GOTREF(__pyx_t_2);
3287 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3296 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bs);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
3297 __Pyx_GOTREF(__pyx_t_1);
3306 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
3307 __Pyx_GOTREF(__pyx_t_3);
3308 __Pyx_GIVEREF(__pyx_t_2);
3309 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3310 __Pyx_GIVEREF(__pyx_t_1);
3311 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
3314 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10csmoothers_cBASMFactor), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3315 __Pyx_GOTREF(__pyx_t_1);
3316 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3317 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cBASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
3318 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3329 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3332 __Pyx_XDECREF(__pyx_t_1);
3333 __Pyx_XDECREF(__pyx_t_2);
3334 __Pyx_XDECREF(__pyx_t_3);
3335 __Pyx_AddTraceback(
"csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3338 __Pyx_XGIVEREF(__pyx_r);
3339 __Pyx_RefNannyFinishContext();
3352 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3353 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3354 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
3357 __Pyx_RefNannyDeclarations
3358 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
3360 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,&__pyx_n_s_bs,0};
3361 PyObject* values[2] = {0,0};
3362 if (unlikely(__pyx_kwds)) {
3364 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3366 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3368 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3371 default:
goto __pyx_L5_argtuple_error;
3373 kw_args = PyDict_Size(__pyx_kwds);
3376 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3377 else goto __pyx_L5_argtuple_error;
3380 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3382 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 52, __pyx_L3_error)
3385 if (unlikely(kw_args > 0)) {
3386 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3388 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3389 goto __pyx_L5_argtuple_error;
3391 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3392 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3394 __pyx_v_L = ((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
3395 __pyx_v_bs = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_bs == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error)
3397 goto __pyx_L4_argument_unpacking_done;
3398 __pyx_L5_argtuple_error:;
3399 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3401 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3402 __Pyx_RefNannyFinishContext();
3404 __pyx_L4_argument_unpacking_done:;
3405 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1,
"L", 0))) __PYX_ERR(0, 53, __pyx_L1_error)
3406 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor___cinit__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), __pyx_v_L, __pyx_v_bs);
3413 __Pyx_RefNannyFinishContext();
3417 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L,
int __pyx_v_bs) {
3419 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3421 __Pyx_RefNannyDeclarations
3422 PyObject *__pyx_t_1 = NULL;
3424 __Pyx_RefNannySetupContext(
"__cinit__", 0);
3442 __pyx_v_AS.Stype = SLU_NR;
3451 __pyx_v_AS.Dtype = SLU_D;
3460 __pyx_v_AS.Mtype = SLU_GE;
3469 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3470 __Pyx_GOTREF(__pyx_t_1);
3471 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
3472 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3473 __pyx_v_AS.nrow = __pyx_t_2;
3482 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
3483 __Pyx_GOTREF(__pyx_t_1);
3484 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
3485 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3486 __pyx_v_AS.ncol = __pyx_t_2;
3495 __pyx_v_AS.Store = (&__pyx_v_L->A);
3504 __pyx_v_rval =
basm_NR_init(__pyx_v_bs, (&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots), (&__pyx_v_self->subdomain_col_pivots));
3513 #ifndef CYTHON_WITHOUT_ASSERTIONS
3514 if (unlikely(!Py_OptimizeFlag)) {
3515 if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3516 PyErr_SetNone(PyExc_AssertionError);
3517 __PYX_ERR(0, 72, __pyx_L1_error)
3534 __Pyx_XDECREF(__pyx_t_1);
3535 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3538 __Pyx_RefNannyFinishContext();
3551 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self);
3552 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3553 __Pyx_RefNannyDeclarations
3554 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3555 __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3558 __Pyx_RefNannyFinishContext();
3561 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3562 __Pyx_RefNannyDeclarations
3563 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3572 basm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots, __pyx_v_self->subdomain_col_pivots);
3583 __Pyx_RefNannyFinishContext();
3593 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3594 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3595 PyObject *__pyx_r = 0;
3596 __Pyx_RefNannyDeclarations
3597 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
3598 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3601 __Pyx_RefNannyFinishContext();
3605 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3606 PyObject *__pyx_r = NULL;
3607 __Pyx_RefNannyDeclarations
3608 PyObject *__pyx_t_1 = NULL;
3609 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
3617 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3618 __Pyx_GOTREF(__pyx_t_1);
3619 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3620 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3621 __PYX_ERR(1, 2, __pyx_L1_error)
3631 __Pyx_XDECREF(__pyx_t_1);
3632 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3634 __Pyx_XGIVEREF(__pyx_r);
3635 __Pyx_RefNannyFinishContext();
3647 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3648 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3649 PyObject *__pyx_r = 0;
3650 __Pyx_RefNannyDeclarations
3651 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
3652 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3655 __Pyx_RefNannyFinishContext();
3659 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3660 PyObject *__pyx_r = NULL;
3661 __Pyx_RefNannyDeclarations
3662 PyObject *__pyx_t_1 = NULL;
3663 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
3670 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3671 __Pyx_GOTREF(__pyx_t_1);
3672 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3673 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3674 __PYX_ERR(1, 4, __pyx_L1_error)
3685 __Pyx_XDECREF(__pyx_t_1);
3686 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3688 __Pyx_XGIVEREF(__pyx_r);
3689 __Pyx_RefNannyFinishContext();
3702 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3703 static char __pyx_doc_10csmoothers_jacobi_NR_prepare[] =
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n w : double\n tol : double\n M : np.array\n ";
3704 static PyMethodDef __pyx_mdef_10csmoothers_1jacobi_NR_prepare = {
"jacobi_NR_prepare", (PyCFunction)__pyx_pw_10csmoothers_1jacobi_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_jacobi_NR_prepare};
3705 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3706 PyObject *__pyx_v_A = 0;
3707 PyObject *__pyx_v_w = 0;
3708 PyObject *__pyx_v_tol = 0;
3709 PyObject *__pyx_v_M = 0;
3710 PyObject *__pyx_r = 0;
3711 __Pyx_RefNannyDeclarations
3712 __Pyx_RefNannySetupContext(
"jacobi_NR_prepare (wrapper)", 0);
3714 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
3715 PyObject* values[4] = {0,0,0,0};
3716 if (unlikely(__pyx_kwds)) {
3718 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3720 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3722 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3724 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3726 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3729 default:
goto __pyx_L5_argtuple_error;
3731 kw_args = PyDict_Size(__pyx_kwds);
3734 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3735 else goto __pyx_L5_argtuple_error;
3738 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
3740 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, 1); __PYX_ERR(0, 84, __pyx_L3_error)
3744 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
3746 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, 2); __PYX_ERR(0, 84, __pyx_L3_error)
3750 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
3752 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, 3); __PYX_ERR(0, 84, __pyx_L3_error)
3755 if (unlikely(kw_args > 0)) {
3756 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"jacobi_NR_prepare") < 0)) __PYX_ERR(0, 84, __pyx_L3_error)
3758 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3759 goto __pyx_L5_argtuple_error;
3761 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3762 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3763 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3764 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3766 __pyx_v_A = values[0];
3767 __pyx_v_w = values[1];
3768 __pyx_v_tol = values[2];
3769 __pyx_v_M = values[3];
3771 goto __pyx_L4_argument_unpacking_done;
3772 __pyx_L5_argtuple_error:;
3773 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error)
3775 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
3776 __Pyx_RefNannyFinishContext();
3778 __pyx_L4_argument_unpacking_done:;
3779 __pyx_r = __pyx_pf_10csmoothers_jacobi_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
3782 __Pyx_RefNannyFinishContext();
3786 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
3787 PyObject *__pyx_r = NULL;
3788 __Pyx_RefNannyDeclarations
3789 PyObject *__pyx_t_1 = NULL;
3792 __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
3793 __Pyx_RefNannySetupContext(
"jacobi_NR_prepare", 0);
3802 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
3803 __Pyx_GOTREF(__pyx_t_1);
3804 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 94, __pyx_L1_error)
3805 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
3806 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_3 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
3807 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 94, __pyx_L1_error)
3808 __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
3809 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3810 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3811 __pyx_t_4.memview = NULL;
3812 __pyx_t_4.data = NULL;
3823 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3826 __Pyx_XDECREF(__pyx_t_1);
3827 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3828 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
3831 __Pyx_XGIVEREF(__pyx_r);
3832 __Pyx_RefNannyFinishContext();
3844 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
3845 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3846 __Pyx_RefNannyDeclarations
3847 PyObject *__pyx_t_1 = NULL;
3849 Py_ssize_t __pyx_t_3;
3850 __Pyx_RefNannySetupContext(
"smootherWrappersjacobi_NR_prepare", 0);
3859 __pyx_v_AS.Stype = SLU_NR;
3868 __pyx_v_AS.Dtype = SLU_D;
3877 __pyx_v_AS.Mtype = SLU_GE;
3886 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
3887 __Pyx_GOTREF(__pyx_t_1);
3888 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
3889 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3890 __pyx_v_AS.nrow = __pyx_t_2;
3899 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
3900 __Pyx_GOTREF(__pyx_t_1);
3901 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
3902 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3903 __pyx_v_AS.ncol = __pyx_t_2;
3912 __pyx_v_AS.Store = (&__pyx_v_sm->A);
3923 if (__pyx_t_3 < 0) {
3924 __pyx_t_3 += __pyx_v_M.shape[0];
3925 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
3926 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
3927 if (unlikely(__pyx_t_2 != -1)) {
3928 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3929 __PYX_ERR(0, 107, __pyx_L1_error)
3931 jacobi_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
3944 __Pyx_XDECREF(__pyx_t_1);
3945 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersjacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3947 __Pyx_RefNannyFinishContext();
3959 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3960 static char __pyx_doc_10csmoothers_2jacobi_NR_solve[] =
"\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
3961 static PyMethodDef __pyx_mdef_10csmoothers_3jacobi_NR_solve = {
"jacobi_NR_solve", (PyCFunction)__pyx_pw_10csmoothers_3jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_2jacobi_NR_solve};
3962 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3963 PyObject *__pyx_v_A = 0;
3964 PyObject *__pyx_v_M = 0;
3965 PyObject *__pyx_v_R = 0;
3966 PyObject *__pyx_v_node_order = 0;
3967 PyObject *__pyx_v_dX = 0;
3968 PyObject *__pyx_r = 0;
3969 __Pyx_RefNannyDeclarations
3970 __Pyx_RefNannySetupContext(
"jacobi_NR_solve (wrapper)", 0);
3972 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
3973 PyObject* values[5] = {0,0,0,0,0};
3974 if (unlikely(__pyx_kwds)) {
3976 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3978 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3980 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3982 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3984 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3986 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3989 default:
goto __pyx_L5_argtuple_error;
3991 kw_args = PyDict_Size(__pyx_kwds);
3994 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3995 else goto __pyx_L5_argtuple_error;
3998 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4000 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 109, __pyx_L3_error)
4004 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4006 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 109, __pyx_L3_error)
4010 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4012 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 109, __pyx_L3_error)
4016 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4018 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 109, __pyx_L3_error)
4021 if (unlikely(kw_args > 0)) {
4022 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"jacobi_NR_solve") < 0)) __PYX_ERR(0, 109, __pyx_L3_error)
4024 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4025 goto __pyx_L5_argtuple_error;
4027 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4028 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4029 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4030 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4031 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4033 __pyx_v_A = values[0];
4034 __pyx_v_M = values[1];
4035 __pyx_v_R = values[2];
4036 __pyx_v_node_order = values[3];
4037 __pyx_v_dX = values[4];
4039 goto __pyx_L4_argument_unpacking_done;
4040 __pyx_L5_argtuple_error:;
4041 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 109, __pyx_L3_error)
4043 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4044 __Pyx_RefNannyFinishContext();
4046 __pyx_L4_argument_unpacking_done:;
4047 __pyx_r = __pyx_pf_10csmoothers_2jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
4050 __Pyx_RefNannyFinishContext();
4054 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
4055 PyObject *__pyx_r = NULL;
4056 __Pyx_RefNannyDeclarations
4057 PyObject *__pyx_t_1 = NULL;
4058 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4059 __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4060 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4061 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4062 __Pyx_RefNannySetupContext(
"jacobi_NR_solve", 0);
4071 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
4072 __Pyx_GOTREF(__pyx_t_1);
4073 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 120, __pyx_L1_error)
4074 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4075 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4076 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4077 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4078 __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
4079 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4080 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4081 __pyx_t_2.memview = NULL;
4082 __pyx_t_2.data = NULL;
4083 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4084 __pyx_t_3.memview = NULL;
4085 __pyx_t_3.data = NULL;
4086 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4087 __pyx_t_4.memview = NULL;
4088 __pyx_t_4.data = NULL;
4089 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4090 __pyx_t_5.memview = NULL;
4091 __pyx_t_5.data = NULL;
4102 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4105 __Pyx_XDECREF(__pyx_t_1);
4106 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4107 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4108 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4109 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4110 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4113 __Pyx_XGIVEREF(__pyx_r);
4114 __Pyx_RefNannyFinishContext();
4126 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4127 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4128 __Pyx_RefNannyDeclarations
4129 PyObject *__pyx_t_1 = NULL;
4131 Py_ssize_t __pyx_t_3;
4132 Py_ssize_t __pyx_t_4;
4133 Py_ssize_t __pyx_t_5;
4134 Py_ssize_t __pyx_t_6;
4135 __Pyx_RefNannySetupContext(
"smootherWrappersjacobi_NR_solve", 0);
4144 __pyx_v_AS.Stype = SLU_NR;
4153 __pyx_v_AS.Dtype = SLU_D;
4162 __pyx_v_AS.Mtype = SLU_GE;
4171 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
4172 __Pyx_GOTREF(__pyx_t_1);
4173 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
4174 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4175 __pyx_v_AS.nrow = __pyx_t_2;
4184 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
4185 __Pyx_GOTREF(__pyx_t_1);
4186 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
4187 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4188 __pyx_v_AS.ncol = __pyx_t_2;
4197 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4208 if (__pyx_t_3 < 0) {
4209 __pyx_t_3 += __pyx_v_M.shape[0];
4210 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4211 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4212 if (unlikely(__pyx_t_2 != -1)) {
4213 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4214 __PYX_ERR(0, 134, __pyx_L1_error)
4218 if (__pyx_t_4 < 0) {
4219 __pyx_t_4 += __pyx_v_R.shape[0];
4220 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4221 }
else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4222 if (unlikely(__pyx_t_2 != -1)) {
4223 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4224 __PYX_ERR(0, 134, __pyx_L1_error)
4228 if (__pyx_t_5 < 0) {
4229 __pyx_t_5 += __pyx_v_node_order.shape[0];
4230 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4231 }
else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4232 if (unlikely(__pyx_t_2 != -1)) {
4233 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4234 __PYX_ERR(0, 134, __pyx_L1_error)
4238 if (__pyx_t_6 < 0) {
4239 __pyx_t_6 += __pyx_v_dX.shape[0];
4240 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
4241 }
else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4242 if (unlikely(__pyx_t_2 != -1)) {
4243 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4244 __PYX_ERR(0, 134, __pyx_L1_error)
4246 jacobi_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
4259 __Pyx_XDECREF(__pyx_t_1);
4260 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersjacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4262 __Pyx_RefNannyFinishContext();
4274 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4275 static char __pyx_doc_10csmoothers_4nl_jacobi_NR_solve[] =
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : np.float\n tol : np.float\n dX : np.array double\n ";
4276 static PyMethodDef __pyx_mdef_10csmoothers_5nl_jacobi_NR_solve = {
"nl_jacobi_NR_solve", (PyCFunction)__pyx_pw_10csmoothers_5nl_jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_4nl_jacobi_NR_solve};
4277 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4278 PyObject *__pyx_v_A = 0;
4279 PyObject *__pyx_v_R = 0;
4280 PyObject *__pyx_v_node_order = 0;
4281 PyObject *__pyx_v_w = 0;
4282 PyObject *__pyx_v_tol = 0;
4283 PyObject *__pyx_v_dX = 0;
4284 PyObject *__pyx_r = 0;
4285 __Pyx_RefNannyDeclarations
4286 __Pyx_RefNannySetupContext(
"nl_jacobi_NR_solve (wrapper)", 0);
4288 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
4289 PyObject* values[6] = {0,0,0,0,0,0};
4290 if (unlikely(__pyx_kwds)) {
4292 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4294 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4296 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4298 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4300 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4302 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4304 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4307 default:
goto __pyx_L5_argtuple_error;
4309 kw_args = PyDict_Size(__pyx_kwds);
4312 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4313 else goto __pyx_L5_argtuple_error;
4316 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4318 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 136, __pyx_L3_error)
4322 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4324 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 136, __pyx_L3_error)
4328 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4330 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 136, __pyx_L3_error)
4334 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4336 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 136, __pyx_L3_error)
4340 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4342 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 136, __pyx_L3_error)
4345 if (unlikely(kw_args > 0)) {
4346 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"nl_jacobi_NR_solve") < 0)) __PYX_ERR(0, 136, __pyx_L3_error)
4348 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4349 goto __pyx_L5_argtuple_error;
4351 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4352 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4353 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4354 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4355 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4356 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4358 __pyx_v_A = values[0];
4359 __pyx_v_R = values[1];
4360 __pyx_v_node_order = values[2];
4361 __pyx_v_w = values[3];
4362 __pyx_v_tol = values[4];
4363 __pyx_v_dX = values[5];
4365 goto __pyx_L4_argument_unpacking_done;
4366 __pyx_L5_argtuple_error:;
4367 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error)
4369 __Pyx_AddTraceback(
"csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4370 __Pyx_RefNannyFinishContext();
4372 __pyx_L4_argument_unpacking_done:;
4373 __pyx_r = __pyx_pf_10csmoothers_4nl_jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
4376 __Pyx_RefNannyFinishContext();
4380 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
4381 PyObject *__pyx_r = NULL;
4382 __Pyx_RefNannyDeclarations
4383 PyObject *__pyx_t_1 = NULL;
4384 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4385 __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4388 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4389 __Pyx_RefNannySetupContext(
"nl_jacobi_NR_solve", 0);
4398 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
4399 __Pyx_GOTREF(__pyx_t_1);
4400 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 148, __pyx_L1_error)
4401 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4402 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4403 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4404 __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_5 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4405 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4406 __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
4407 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4408 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4409 __pyx_t_2.memview = NULL;
4410 __pyx_t_2.data = NULL;
4411 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4412 __pyx_t_3.memview = NULL;
4413 __pyx_t_3.data = NULL;
4414 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4415 __pyx_t_6.memview = NULL;
4416 __pyx_t_6.data = NULL;
4427 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4430 __Pyx_XDECREF(__pyx_t_1);
4431 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4432 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4433 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4434 __Pyx_AddTraceback(
"csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4437 __Pyx_XGIVEREF(__pyx_r);
4438 __Pyx_RefNannyFinishContext();
4450 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4451 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4452 __Pyx_RefNannyDeclarations
4453 PyObject *__pyx_t_1 = NULL;
4455 Py_ssize_t __pyx_t_3;
4456 Py_ssize_t __pyx_t_4;
4457 Py_ssize_t __pyx_t_5;
4458 __Pyx_RefNannySetupContext(
"smootherWrappersnl_jacobi_NR_solve", 0);
4467 __pyx_v_AS.Stype = SLU_NR;
4476 __pyx_v_AS.Dtype = SLU_D;
4485 __pyx_v_AS.Mtype = SLU_GE;
4494 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
4495 __Pyx_GOTREF(__pyx_t_1);
4496 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
4497 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4498 __pyx_v_AS.nrow = __pyx_t_2;
4507 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
4508 __Pyx_GOTREF(__pyx_t_1);
4509 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
4510 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4511 __pyx_v_AS.ncol = __pyx_t_2;
4520 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4531 if (__pyx_t_3 < 0) {
4532 __pyx_t_3 += __pyx_v_R.shape[0];
4533 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4534 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4535 if (unlikely(__pyx_t_2 != -1)) {
4536 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4537 __PYX_ERR(0, 163, __pyx_L1_error)
4541 if (__pyx_t_4 < 0) {
4542 __pyx_t_4 += __pyx_v_node_order.shape[0];
4543 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4544 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4545 if (unlikely(__pyx_t_2 != -1)) {
4546 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4547 __PYX_ERR(0, 163, __pyx_L1_error)
4551 if (__pyx_t_5 < 0) {
4552 __pyx_t_5 += __pyx_v_dX.shape[0];
4553 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4554 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4555 if (unlikely(__pyx_t_2 != -1)) {
4556 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4557 __PYX_ERR(0, 163, __pyx_L1_error)
4559 nl_jacobi_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
4572 __Pyx_XDECREF(__pyx_t_1);
4573 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersnl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4575 __Pyx_RefNannyFinishContext();
4587 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4588 static char __pyx_doc_10csmoothers_6gauss_seidel_NR_preare[] =
"\n\n Arguments\n ---------\n A :\n w :\n tol :\n M :\n ";
4589 static PyMethodDef __pyx_mdef_10csmoothers_7gauss_seidel_NR_preare = {
"gauss_seidel_NR_preare", (PyCFunction)__pyx_pw_10csmoothers_7gauss_seidel_NR_preare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_6gauss_seidel_NR_preare};
4590 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4591 PyObject *__pyx_v_A = 0;
4592 PyObject *__pyx_v_w = 0;
4593 PyObject *__pyx_v_tol = 0;
4594 PyObject *__pyx_v_M = 0;
4595 PyObject *__pyx_r = 0;
4596 __Pyx_RefNannyDeclarations
4597 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_preare (wrapper)", 0);
4599 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
4600 PyObject* values[4] = {0,0,0,0};
4601 if (unlikely(__pyx_kwds)) {
4603 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4605 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4607 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4609 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4611 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4614 default:
goto __pyx_L5_argtuple_error;
4616 kw_args = PyDict_Size(__pyx_kwds);
4619 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4620 else goto __pyx_L5_argtuple_error;
4623 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4625 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, 1); __PYX_ERR(0, 165, __pyx_L3_error)
4629 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4631 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, 2); __PYX_ERR(0, 165, __pyx_L3_error)
4635 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4637 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, 3); __PYX_ERR(0, 165, __pyx_L3_error)
4640 if (unlikely(kw_args > 0)) {
4641 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"gauss_seidel_NR_preare") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
4643 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4644 goto __pyx_L5_argtuple_error;
4646 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4647 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4648 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4649 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4651 __pyx_v_A = values[0];
4652 __pyx_v_w = values[1];
4653 __pyx_v_tol = values[2];
4654 __pyx_v_M = values[3];
4656 goto __pyx_L4_argument_unpacking_done;
4657 __pyx_L5_argtuple_error:;
4658 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
4660 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4661 __Pyx_RefNannyFinishContext();
4663 __pyx_L4_argument_unpacking_done:;
4664 __pyx_r = __pyx_pf_10csmoothers_6gauss_seidel_NR_preare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
4667 __Pyx_RefNannyFinishContext();
4671 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
4672 PyObject *__pyx_r = NULL;
4673 __Pyx_RefNannyDeclarations
4674 PyObject *__pyx_t_1 = NULL;
4677 __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4678 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_preare", 0);
4687 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
4688 __Pyx_GOTREF(__pyx_t_1);
4689 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 175, __pyx_L1_error)
4690 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4691 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_3 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4692 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 175, __pyx_L1_error)
4693 __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
4694 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4695 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4696 __pyx_t_4.memview = NULL;
4697 __pyx_t_4.data = NULL;
4708 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4711 __Pyx_XDECREF(__pyx_t_1);
4712 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4713 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4716 __Pyx_XGIVEREF(__pyx_r);
4717 __Pyx_RefNannyFinishContext();
4729 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
4730 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4731 __Pyx_RefNannyDeclarations
4732 PyObject *__pyx_t_1 = NULL;
4734 Py_ssize_t __pyx_t_3;
4735 __Pyx_RefNannySetupContext(
"smootherWrappersgauss_seidel_NR_prepare", 0);
4744 __pyx_v_AS.Stype = SLU_NR;
4753 __pyx_v_AS.Dtype = SLU_D;
4762 __pyx_v_AS.Mtype = SLU_GE;
4771 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
4772 __Pyx_GOTREF(__pyx_t_1);
4773 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
4774 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4775 __pyx_v_AS.nrow = __pyx_t_2;
4784 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
4785 __Pyx_GOTREF(__pyx_t_1);
4786 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
4787 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4788 __pyx_v_AS.ncol = __pyx_t_2;
4797 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4808 if (__pyx_t_3 < 0) {
4809 __pyx_t_3 += __pyx_v_M.shape[0];
4810 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4811 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4812 if (unlikely(__pyx_t_2 != -1)) {
4813 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4814 __PYX_ERR(0, 188, __pyx_L1_error)
4816 gauss_seidel_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
4829 __Pyx_XDECREF(__pyx_t_1);
4830 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersgauss_seidel_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4832 __Pyx_RefNannyFinishContext();
4844 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4845 static char __pyx_doc_10csmoothers_8gauss_seidel_NR_solve[] =
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
4846 static PyMethodDef __pyx_mdef_10csmoothers_9gauss_seidel_NR_solve = {
"gauss_seidel_NR_solve", (PyCFunction)__pyx_pw_10csmoothers_9gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_8gauss_seidel_NR_solve};
4847 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4848 PyObject *__pyx_v_A = 0;
4849 PyObject *__pyx_v_M = 0;
4850 PyObject *__pyx_v_R = 0;
4851 PyObject *__pyx_v_node_order = 0;
4852 PyObject *__pyx_v_dX = 0;
4853 PyObject *__pyx_r = 0;
4854 __Pyx_RefNannyDeclarations
4855 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_solve (wrapper)", 0);
4857 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
4858 PyObject* values[5] = {0,0,0,0,0};
4859 if (unlikely(__pyx_kwds)) {
4861 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4863 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4865 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4867 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4869 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4871 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4874 default:
goto __pyx_L5_argtuple_error;
4876 kw_args = PyDict_Size(__pyx_kwds);
4879 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4880 else goto __pyx_L5_argtuple_error;
4883 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4885 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 190, __pyx_L3_error)
4889 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4891 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 190, __pyx_L3_error)
4895 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4897 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 190, __pyx_L3_error)
4901 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4903 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 190, __pyx_L3_error)
4906 if (unlikely(kw_args > 0)) {
4907 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 190, __pyx_L3_error)
4909 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4910 goto __pyx_L5_argtuple_error;
4912 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4913 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4914 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4915 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4916 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4918 __pyx_v_A = values[0];
4919 __pyx_v_M = values[1];
4920 __pyx_v_R = values[2];
4921 __pyx_v_node_order = values[3];
4922 __pyx_v_dX = values[4];
4924 goto __pyx_L4_argument_unpacking_done;
4925 __pyx_L5_argtuple_error:;
4926 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 190, __pyx_L3_error)
4928 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4929 __Pyx_RefNannyFinishContext();
4931 __pyx_L4_argument_unpacking_done:;
4932 __pyx_r = __pyx_pf_10csmoothers_8gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
4935 __Pyx_RefNannyFinishContext();
4939 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
4940 PyObject *__pyx_r = NULL;
4941 __Pyx_RefNannyDeclarations
4942 PyObject *__pyx_t_1 = NULL;
4943 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4944 __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4945 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4946 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4947 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_solve", 0);
4956 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
4957 __Pyx_GOTREF(__pyx_t_1);
4958 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 201, __pyx_L1_error)
4959 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
4960 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
4961 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
4962 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
4963 __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
4964 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4965 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4966 __pyx_t_2.memview = NULL;
4967 __pyx_t_2.data = NULL;
4968 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4969 __pyx_t_3.memview = NULL;
4970 __pyx_t_3.data = NULL;
4971 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4972 __pyx_t_4.memview = NULL;
4973 __pyx_t_4.data = NULL;
4974 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4975 __pyx_t_5.memview = NULL;
4976 __pyx_t_5.data = NULL;
4987 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4990 __Pyx_XDECREF(__pyx_t_1);
4991 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4992 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4993 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4994 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4995 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4998 __Pyx_XGIVEREF(__pyx_r);
4999 __Pyx_RefNannyFinishContext();
5011 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5012 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5013 __Pyx_RefNannyDeclarations
5014 PyObject *__pyx_t_1 = NULL;
5016 Py_ssize_t __pyx_t_3;
5017 Py_ssize_t __pyx_t_4;
5018 Py_ssize_t __pyx_t_5;
5019 Py_ssize_t __pyx_t_6;
5020 __Pyx_RefNannySetupContext(
"smootherWrappersgauss_seidel_NR_solve", 0);
5029 __pyx_v_AS.Stype = SLU_NR;
5038 __pyx_v_AS.Dtype = SLU_D;
5047 __pyx_v_AS.Mtype = SLU_GE;
5056 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
5057 __Pyx_GOTREF(__pyx_t_1);
5058 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error)
5059 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5060 __pyx_v_AS.nrow = __pyx_t_2;
5069 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
5070 __Pyx_GOTREF(__pyx_t_1);
5071 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error)
5072 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5073 __pyx_v_AS.ncol = __pyx_t_2;
5082 __pyx_v_AS.Store = (&__pyx_v_sm->A);
5093 if (__pyx_t_3 < 0) {
5094 __pyx_t_3 += __pyx_v_M.shape[0];
5095 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5096 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
5097 if (unlikely(__pyx_t_2 != -1)) {
5098 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5099 __PYX_ERR(0, 215, __pyx_L1_error)
5103 if (__pyx_t_4 < 0) {
5104 __pyx_t_4 += __pyx_v_R.shape[0];
5105 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5106 }
else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5107 if (unlikely(__pyx_t_2 != -1)) {
5108 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5109 __PYX_ERR(0, 215, __pyx_L1_error)
5113 if (__pyx_t_5 < 0) {
5114 __pyx_t_5 += __pyx_v_node_order.shape[0];
5115 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5116 }
else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5117 if (unlikely(__pyx_t_2 != -1)) {
5118 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5119 __PYX_ERR(0, 215, __pyx_L1_error)
5123 if (__pyx_t_6 < 0) {
5124 __pyx_t_6 += __pyx_v_dX.shape[0];
5125 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
5126 }
else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5127 if (unlikely(__pyx_t_2 != -1)) {
5128 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5129 __PYX_ERR(0, 215, __pyx_L1_error)
5131 gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
5144 __Pyx_XDECREF(__pyx_t_1);
5145 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersgauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5147 __Pyx_RefNannyFinishContext();
5159 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5160 static char __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve[] =
"\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : double\n tol : double\n dX : np.array double\n ";
5161 static PyMethodDef __pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve = {
"nl_gauss_seidel_NR_solve", (PyCFunction)__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve};
5162 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5163 PyObject *__pyx_v_A = 0;
5164 PyObject *__pyx_v_R = 0;
5165 PyObject *__pyx_v_node_order = 0;
5166 PyObject *__pyx_v_w = 0;
5167 PyObject *__pyx_v_tol = 0;
5168 PyObject *__pyx_v_dX = 0;
5169 PyObject *__pyx_r = 0;
5170 __Pyx_RefNannyDeclarations
5171 __Pyx_RefNannySetupContext(
"nl_gauss_seidel_NR_solve (wrapper)", 0);
5173 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
5174 PyObject* values[6] = {0,0,0,0,0,0};
5175 if (unlikely(__pyx_kwds)) {
5177 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5179 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5181 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5183 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5185 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5187 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5189 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5192 default:
goto __pyx_L5_argtuple_error;
5194 kw_args = PyDict_Size(__pyx_kwds);
5197 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5198 else goto __pyx_L5_argtuple_error;
5201 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5203 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 217, __pyx_L3_error)
5207 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5209 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 217, __pyx_L3_error)
5213 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
5215 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 217, __pyx_L3_error)
5219 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
5221 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 217, __pyx_L3_error)
5225 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5227 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 217, __pyx_L3_error)
5230 if (unlikely(kw_args > 0)) {
5231 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"nl_gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
5233 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5234 goto __pyx_L5_argtuple_error;
5236 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5237 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5238 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5239 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5240 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5241 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5243 __pyx_v_A = values[0];
5244 __pyx_v_R = values[1];
5245 __pyx_v_node_order = values[2];
5246 __pyx_v_w = values[3];
5247 __pyx_v_tol = values[4];
5248 __pyx_v_dX = values[5];
5250 goto __pyx_L4_argument_unpacking_done;
5251 __pyx_L5_argtuple_error:;
5252 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
5254 __Pyx_AddTraceback(
"csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5255 __Pyx_RefNannyFinishContext();
5257 __pyx_L4_argument_unpacking_done:;
5258 __pyx_r = __pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
5261 __Pyx_RefNannyFinishContext();
5265 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
5266 PyObject *__pyx_r = NULL;
5267 __Pyx_RefNannyDeclarations
5268 PyObject *__pyx_t_1 = NULL;
5269 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5270 __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5273 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5274 PyObject *__pyx_t_7 = NULL;
5275 __Pyx_RefNannySetupContext(
"nl_gauss_seidel_NR_solve", 0);
5284 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5285 __Pyx_GOTREF(__pyx_t_1);
5286 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5295 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 230, __pyx_L1_error)
5304 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 231, __pyx_L1_error)
5313 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
5322 __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_5 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
5331 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 234, __pyx_L1_error)
5340 __pyx_t_7 = __pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
5341 __Pyx_GOTREF(__pyx_t_7);
5342 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5343 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5344 __pyx_t_2.memview = NULL;
5345 __pyx_t_2.data = NULL;
5346 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5347 __pyx_t_3.memview = NULL;
5348 __pyx_t_3.data = NULL;
5349 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5350 __pyx_t_6.memview = NULL;
5351 __pyx_t_6.data = NULL;
5352 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5363 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5366 __Pyx_XDECREF(__pyx_t_1);
5367 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5368 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5369 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5370 __Pyx_XDECREF(__pyx_t_7);
5371 __Pyx_AddTraceback(
"csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5374 __Pyx_XGIVEREF(__pyx_r);
5375 __Pyx_RefNannyFinishContext();
5387 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5388 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5389 PyObject *__pyx_r = NULL;
5390 __Pyx_RefNannyDeclarations
5391 PyObject *__pyx_t_1 = NULL;
5393 Py_ssize_t __pyx_t_3;
5394 Py_ssize_t __pyx_t_4;
5395 Py_ssize_t __pyx_t_5;
5396 __Pyx_RefNannySetupContext(
"smootherWrappers_nl_gauss_seidel_NR_solve", 0);
5405 __pyx_v_AS.Stype = SLU_NR;
5414 __pyx_v_AS.Dtype = SLU_D;
5423 __pyx_v_AS.Mtype = SLU_GE;
5432 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
5433 __Pyx_GOTREF(__pyx_t_1);
5434 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
5435 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5436 __pyx_v_AS.nrow = __pyx_t_2;
5445 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
5446 __Pyx_GOTREF(__pyx_t_1);
5447 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
5448 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5449 __pyx_v_AS.ncol = __pyx_t_2;
5458 __pyx_v_AS.Store = (&__pyx_v_sm->A);
5469 if (__pyx_t_3 < 0) {
5470 __pyx_t_3 += __pyx_v_R.shape[0];
5471 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5472 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5473 if (unlikely(__pyx_t_2 != -1)) {
5474 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5475 __PYX_ERR(0, 249, __pyx_L1_error)
5479 if (__pyx_t_4 < 0) {
5480 __pyx_t_4 += __pyx_v_node_order.shape[0];
5481 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5482 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5483 if (unlikely(__pyx_t_2 != -1)) {
5484 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5485 __PYX_ERR(0, 249, __pyx_L1_error)
5489 if (__pyx_t_5 < 0) {
5490 __pyx_t_5 += __pyx_v_dX.shape[0];
5491 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5492 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5493 if (unlikely(__pyx_t_2 != -1)) {
5494 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5495 __PYX_ERR(0, 249, __pyx_L1_error)
5497 nl_gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
5508 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5511 __Pyx_XDECREF(__pyx_t_1);
5512 __Pyx_AddTraceback(
"csmoothers.smootherWrappers_nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5515 __Pyx_XGIVEREF(__pyx_r);
5516 __Pyx_RefNannyFinishContext();
5529 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5530 static char __pyx_doc_10csmoothers_12asm_NR_prepare[] =
"\n\n Arguments\n ---------\n A :\n asmFactor :\n ";
5531 static PyMethodDef __pyx_mdef_10csmoothers_13asm_NR_prepare = {
"asm_NR_prepare", (PyCFunction)__pyx_pw_10csmoothers_13asm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_12asm_NR_prepare};
5532 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5533 PyObject *__pyx_v_A = 0;
5534 PyObject *__pyx_v_asmFactor = 0;
5535 PyObject *__pyx_r = 0;
5536 __Pyx_RefNannyDeclarations
5537 __Pyx_RefNannySetupContext(
"asm_NR_prepare (wrapper)", 0);
5539 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_asmFactor,0};
5540 PyObject* values[2] = {0,0};
5541 if (unlikely(__pyx_kwds)) {
5543 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5545 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5547 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5550 default:
goto __pyx_L5_argtuple_error;
5552 kw_args = PyDict_Size(__pyx_kwds);
5555 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5556 else goto __pyx_L5_argtuple_error;
5559 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
5561 __Pyx_RaiseArgtupleInvalid(
"asm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 251, __pyx_L3_error)
5564 if (unlikely(kw_args > 0)) {
5565 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asm_NR_prepare") < 0)) __PYX_ERR(0, 251, __pyx_L3_error)
5567 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5568 goto __pyx_L5_argtuple_error;
5570 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5571 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5573 __pyx_v_A = values[0];
5574 __pyx_v_asmFactor = values[1];
5576 goto __pyx_L4_argument_unpacking_done;
5577 __pyx_L5_argtuple_error:;
5578 __Pyx_RaiseArgtupleInvalid(
"asm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 251, __pyx_L3_error)
5580 __Pyx_AddTraceback(
"csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5581 __Pyx_RefNannyFinishContext();
5583 __pyx_L4_argument_unpacking_done:;
5584 __pyx_r = __pyx_pf_10csmoothers_12asm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_asmFactor);
5587 __Pyx_RefNannyFinishContext();
5591 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor) {
5592 PyObject *__pyx_r = NULL;
5593 __Pyx_RefNannyDeclarations
5594 PyObject *__pyx_t_1 = NULL;
5595 PyObject *__pyx_t_2 = NULL;
5596 __Pyx_RefNannySetupContext(
"asm_NR_prepare", 0);
5605 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
5606 __Pyx_GOTREF(__pyx_t_1);
5607 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 259, __pyx_L1_error)
5616 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
5617 __Pyx_GOTREF(__pyx_t_2);
5618 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 260, __pyx_L1_error)
5627 __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_2));
5628 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5629 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5640 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5643 __Pyx_XDECREF(__pyx_t_1);
5644 __Pyx_XDECREF(__pyx_t_2);
5645 __Pyx_AddTraceback(
"csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5648 __Pyx_XGIVEREF(__pyx_r);
5649 __Pyx_RefNannyFinishContext();
5661 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor) {
5662 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5663 __Pyx_RefNannyDeclarations
5664 PyObject *__pyx_t_1 = NULL;
5666 __Pyx_RefNannySetupContext(
"smootherWrappers_asm_NR_prepare", 0);
5675 __pyx_v_AS.Stype = SLU_NR;
5684 __pyx_v_AS.Dtype = SLU_D;
5693 __pyx_v_AS.Mtype = SLU_GE;
5702 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
5703 __Pyx_GOTREF(__pyx_t_1);
5704 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
5705 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5706 __pyx_v_AS.nrow = __pyx_t_2;
5715 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
5716 __Pyx_GOTREF(__pyx_t_1);
5717 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5718 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5719 __pyx_v_AS.ncol = __pyx_t_2;
5728 __pyx_v_AS.Store = (&__pyx_v_sm->A);
5737 asm_NR_prepare((&__pyx_v_AS), __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_pivots);
5750 __Pyx_XDECREF(__pyx_t_1);
5751 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5753 __Pyx_RefNannyFinishContext();
5765 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5766 static char __pyx_doc_10csmoothers_14asm_NR_solve[] =
"\n \n Arguments\n ---------\n A : superluWrappers.sparseMatrix\n w : double\n asmFactor : csmoothers.asmFactor\n node_order : np.array int\n R : np.array double\n dX : np.array double\n ";
5767 static PyMethodDef __pyx_mdef_10csmoothers_15asm_NR_solve = {
"asm_NR_solve", (PyCFunction)__pyx_pw_10csmoothers_15asm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_14asm_NR_solve};
5768 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5769 PyObject *__pyx_v_A = 0;
5770 PyObject *__pyx_v_w = 0;
5771 PyObject *__pyx_v_asmFactor = 0;
5772 PyObject *__pyx_v_node_order = 0;
5773 PyObject *__pyx_v_R = 0;
5774 PyObject *__pyx_v_dX = 0;
5775 PyObject *__pyx_r = 0;
5776 __Pyx_RefNannyDeclarations
5777 __Pyx_RefNannySetupContext(
"asm_NR_solve (wrapper)", 0);
5779 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_asmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
5780 PyObject* values[6] = {0,0,0,0,0,0};
5781 if (unlikely(__pyx_kwds)) {
5783 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5785 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5787 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5789 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5791 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5793 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5795 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5798 default:
goto __pyx_L5_argtuple_error;
5800 kw_args = PyDict_Size(__pyx_kwds);
5803 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5804 else goto __pyx_L5_argtuple_error;
5807 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
5809 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 277, __pyx_L3_error)
5813 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
5815 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 277, __pyx_L3_error)
5819 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5821 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 277, __pyx_L3_error)
5825 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5827 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 277, __pyx_L3_error)
5831 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5833 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 277, __pyx_L3_error)
5836 if (unlikely(kw_args > 0)) {
5837 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asm_NR_solve") < 0)) __PYX_ERR(0, 277, __pyx_L3_error)
5839 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5840 goto __pyx_L5_argtuple_error;
5842 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5843 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5844 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5845 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5846 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5847 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5849 __pyx_v_A = values[0];
5850 __pyx_v_w = values[1];
5851 __pyx_v_asmFactor = values[2];
5852 __pyx_v_node_order = values[3];
5853 __pyx_v_R = values[4];
5854 __pyx_v_dX = values[5];
5856 goto __pyx_L4_argument_unpacking_done;
5857 __pyx_L5_argtuple_error:;
5858 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error)
5860 __Pyx_AddTraceback(
"csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5861 __Pyx_RefNannyFinishContext();
5863 __pyx_L4_argument_unpacking_done:;
5864 __pyx_r = __pyx_pf_10csmoothers_14asm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_asmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
5867 __Pyx_RefNannyFinishContext();
5871 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
5872 PyObject *__pyx_r = NULL;
5873 __Pyx_RefNannyDeclarations
5874 PyObject *__pyx_t_1 = NULL;
5876 PyObject *__pyx_t_3 = NULL;
5877 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
5878 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
5879 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5880 __Pyx_RefNannySetupContext(
"asm_NR_solve", 0);
5889 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
5890 __Pyx_GOTREF(__pyx_t_1);
5891 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 289, __pyx_L1_error)
5900 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
5909 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
5910 __Pyx_GOTREF(__pyx_t_3);
5911 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 291, __pyx_L1_error)
5920 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 292, __pyx_L1_error)
5929 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 293, __pyx_L1_error)
5938 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 294, __pyx_L1_error)
5947 __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
5948 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5949 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5950 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5951 __pyx_t_4.memview = NULL;
5952 __pyx_t_4.data = NULL;
5953 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5954 __pyx_t_5.memview = NULL;
5955 __pyx_t_5.data = NULL;
5956 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5957 __pyx_t_6.memview = NULL;
5958 __pyx_t_6.data = NULL;
5969 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5972 __Pyx_XDECREF(__pyx_t_1);
5973 __Pyx_XDECREF(__pyx_t_3);
5974 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5975 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5976 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5977 __Pyx_AddTraceback(
"csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5980 __Pyx_XGIVEREF(__pyx_r);
5981 __Pyx_RefNannyFinishContext();
5993 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5994 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5995 __Pyx_RefNannyDeclarations
5996 PyObject *__pyx_t_1 = NULL;
5998 Py_ssize_t __pyx_t_3;
5999 Py_ssize_t __pyx_t_4;
6000 Py_ssize_t __pyx_t_5;
6001 __Pyx_RefNannySetupContext(
"smootherWrappers_asm_NR_solve", 0);
6010 __pyx_v_AS.Stype = SLU_NR;
6019 __pyx_v_AS.Dtype = SLU_D;
6028 __pyx_v_AS.Mtype = SLU_GE;
6037 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
6038 __Pyx_GOTREF(__pyx_t_1);
6039 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error)
6040 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6041 __pyx_v_AS.nrow = __pyx_t_2;
6050 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
6051 __Pyx_GOTREF(__pyx_t_1);
6052 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
6053 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6054 __pyx_v_AS.ncol = __pyx_t_2;
6063 __pyx_v_AS.Store = (&__pyx_v_sm->A);
6074 if (__pyx_t_3 < 0) {
6075 __pyx_t_3 += __pyx_v_R.shape[0];
6076 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6077 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6078 if (unlikely(__pyx_t_2 != -1)) {
6079 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6080 __PYX_ERR(0, 314, __pyx_L1_error)
6092 if (__pyx_t_4 < 0) {
6093 __pyx_t_4 += __pyx_v_node_order.shape[0];
6094 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6095 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6096 if (unlikely(__pyx_t_2 != -1)) {
6097 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6098 __PYX_ERR(0, 316, __pyx_L1_error)
6110 if (__pyx_t_5 < 0) {
6111 __pyx_t_5 += __pyx_v_dX.shape[0];
6112 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6113 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6114 if (unlikely(__pyx_t_2 != -1)) {
6115 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6116 __PYX_ERR(0, 318, __pyx_L1_error)
6126 asm_NR_solve((&__pyx_v_AS), __pyx_v_w, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_asmFactor->subdomain_R, (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_asmFactor->subdomain_dX, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_asmFactor->subdomain_pivots);
6139 __Pyx_XDECREF(__pyx_t_1);
6140 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6142 __Pyx_RefNannyFinishContext();
6154 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6155 static char __pyx_doc_10csmoothers_16basm_NR_prepare[] =
"\n\n Arguments\n ---------\n A :\n basmFactor :\n ";
6156 static PyMethodDef __pyx_mdef_10csmoothers_17basm_NR_prepare = {
"basm_NR_prepare", (PyCFunction)__pyx_pw_10csmoothers_17basm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_16basm_NR_prepare};
6157 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6158 PyObject *__pyx_v_A = 0;
6159 PyObject *__pyx_v_basmFactor = 0;
6160 PyObject *__pyx_r = 0;
6161 __Pyx_RefNannyDeclarations
6162 __Pyx_RefNannySetupContext(
"basm_NR_prepare (wrapper)", 0);
6164 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_basmFactor,0};
6165 PyObject* values[2] = {0,0};
6166 if (unlikely(__pyx_kwds)) {
6168 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6170 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6172 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6175 default:
goto __pyx_L5_argtuple_error;
6177 kw_args = PyDict_Size(__pyx_kwds);
6180 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6181 else goto __pyx_L5_argtuple_error;
6184 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6186 __Pyx_RaiseArgtupleInvalid(
"basm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 321, __pyx_L3_error)
6189 if (unlikely(kw_args > 0)) {
6190 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"basm_NR_prepare") < 0)) __PYX_ERR(0, 321, __pyx_L3_error)
6192 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6193 goto __pyx_L5_argtuple_error;
6195 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6196 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6198 __pyx_v_A = values[0];
6199 __pyx_v_basmFactor = values[1];
6201 goto __pyx_L4_argument_unpacking_done;
6202 __pyx_L5_argtuple_error:;
6203 __Pyx_RaiseArgtupleInvalid(
"basm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 321, __pyx_L3_error)
6205 __Pyx_AddTraceback(
"csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6206 __Pyx_RefNannyFinishContext();
6208 __pyx_L4_argument_unpacking_done:;
6209 __pyx_r = __pyx_pf_10csmoothers_16basm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_basmFactor);
6212 __Pyx_RefNannyFinishContext();
6216 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor) {
6217 PyObject *__pyx_r = NULL;
6218 __Pyx_RefNannyDeclarations
6219 PyObject *__pyx_t_1 = NULL;
6220 PyObject *__pyx_t_2 = NULL;
6221 __Pyx_RefNannySetupContext(
"basm_NR_prepare", 0);
6230 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
6231 __Pyx_GOTREF(__pyx_t_1);
6232 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 329, __pyx_L1_error)
6241 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
6242 __Pyx_GOTREF(__pyx_t_2);
6243 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 330, __pyx_L1_error)
6252 __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_2));
6253 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6254 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6265 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6268 __Pyx_XDECREF(__pyx_t_1);
6269 __Pyx_XDECREF(__pyx_t_2);
6270 __Pyx_AddTraceback(
"csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6273 __Pyx_XGIVEREF(__pyx_r);
6274 __Pyx_RefNannyFinishContext();
6286 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor) {
6287 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6288 __Pyx_RefNannyDeclarations
6289 PyObject *__pyx_t_1 = NULL;
6291 __Pyx_RefNannySetupContext(
"smootherWrappers_basm_NR_prepare", 0);
6300 __pyx_v_AS.Dtype = SLU_D;
6309 __pyx_v_AS.Mtype = SLU_GE;
6318 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
6319 __Pyx_GOTREF(__pyx_t_1);
6320 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
6321 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6322 __pyx_v_AS.nrow = __pyx_t_2;
6331 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
6332 __Pyx_GOTREF(__pyx_t_1);
6333 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
6334 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6335 __pyx_v_AS.ncol = __pyx_t_2;
6344 __pyx_v_AS.Store = (&__pyx_v_sm->A);
6353 basm_NR_prepare(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6366 __Pyx_XDECREF(__pyx_t_1);
6367 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6369 __Pyx_RefNannyFinishContext();
6381 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6382 static char __pyx_doc_10csmoothers_18basm_NR_solve[] =
"\n \n Arguments\n ---------\n A :\n w :\n basmFactor :\n node_order :\n R :\n dX :\n ";
6383 static PyMethodDef __pyx_mdef_10csmoothers_19basm_NR_solve = {
"basm_NR_solve", (PyCFunction)__pyx_pw_10csmoothers_19basm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_18basm_NR_solve};
6384 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6385 PyObject *__pyx_v_A = 0;
6386 PyObject *__pyx_v_w = 0;
6387 PyObject *__pyx_v_basmFactor = 0;
6388 PyObject *__pyx_v_node_order = 0;
6389 PyObject *__pyx_v_R = 0;
6390 PyObject *__pyx_v_dX = 0;
6391 PyObject *__pyx_r = 0;
6392 __Pyx_RefNannyDeclarations
6393 __Pyx_RefNannySetupContext(
"basm_NR_solve (wrapper)", 0);
6395 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_basmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
6396 PyObject* values[6] = {0,0,0,0,0,0};
6397 if (unlikely(__pyx_kwds)) {
6399 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6401 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6403 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6405 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6407 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6409 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6411 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6414 default:
goto __pyx_L5_argtuple_error;
6416 kw_args = PyDict_Size(__pyx_kwds);
6419 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6420 else goto __pyx_L5_argtuple_error;
6423 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6425 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 350, __pyx_L3_error)
6429 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6431 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 350, __pyx_L3_error)
6435 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6437 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 350, __pyx_L3_error)
6441 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6443 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 350, __pyx_L3_error)
6447 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6449 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 350, __pyx_L3_error)
6452 if (unlikely(kw_args > 0)) {
6453 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"basm_NR_solve") < 0)) __PYX_ERR(0, 350, __pyx_L3_error)
6455 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6456 goto __pyx_L5_argtuple_error;
6458 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6459 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6460 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6461 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6462 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6463 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6465 __pyx_v_A = values[0];
6466 __pyx_v_w = values[1];
6467 __pyx_v_basmFactor = values[2];
6468 __pyx_v_node_order = values[3];
6469 __pyx_v_R = values[4];
6470 __pyx_v_dX = values[5];
6472 goto __pyx_L4_argument_unpacking_done;
6473 __pyx_L5_argtuple_error:;
6474 __Pyx_RaiseArgtupleInvalid(
"basm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 350, __pyx_L3_error)
6476 __Pyx_AddTraceback(
"csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6477 __Pyx_RefNannyFinishContext();
6479 __pyx_L4_argument_unpacking_done:;
6480 __pyx_r = __pyx_pf_10csmoothers_18basm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_basmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6483 __Pyx_RefNannyFinishContext();
6487 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6488 PyObject *__pyx_r = NULL;
6489 __Pyx_RefNannyDeclarations
6490 PyObject *__pyx_t_1 = NULL;
6492 PyObject *__pyx_t_3 = NULL;
6493 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6494 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6495 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6496 __Pyx_RefNannySetupContext(
"basm_NR_solve", 0);
6505 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
6506 __Pyx_GOTREF(__pyx_t_1);
6507 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 362, __pyx_L1_error)
6516 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
6525 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error)
6526 __Pyx_GOTREF(__pyx_t_3);
6527 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 364, __pyx_L1_error)
6536 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 365, __pyx_L1_error)
6545 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 366, __pyx_L1_error)
6554 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 367, __pyx_L1_error)
6563 __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6564 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6565 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6566 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6567 __pyx_t_4.memview = NULL;
6568 __pyx_t_4.data = NULL;
6569 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6570 __pyx_t_5.memview = NULL;
6571 __pyx_t_5.data = NULL;
6572 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6573 __pyx_t_6.memview = NULL;
6574 __pyx_t_6.data = NULL;
6585 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6588 __Pyx_XDECREF(__pyx_t_1);
6589 __Pyx_XDECREF(__pyx_t_3);
6590 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6591 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6592 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6593 __Pyx_AddTraceback(
"csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6596 __Pyx_XGIVEREF(__pyx_r);
6597 __Pyx_RefNannyFinishContext();
6609 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6610 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6611 __Pyx_RefNannyDeclarations
6612 PyObject *__pyx_t_1 = NULL;
6614 Py_ssize_t __pyx_t_3;
6615 Py_ssize_t __pyx_t_4;
6616 Py_ssize_t __pyx_t_5;
6617 __Pyx_RefNannySetupContext(
"smootherWrappers_basm_NR_solve", 0);
6626 __pyx_v_AS.Stype = SLU_NR;
6635 __pyx_v_AS.Dtype = SLU_D;
6644 __pyx_v_AS.Mtype = SLU_GE;
6653 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
6654 __Pyx_GOTREF(__pyx_t_1);
6655 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error)
6656 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6657 __pyx_v_AS.nrow = __pyx_t_2;
6666 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
6667 __Pyx_GOTREF(__pyx_t_1);
6668 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
6669 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6670 __pyx_v_AS.ncol = __pyx_t_2;
6679 __pyx_v_AS.Store = (&__pyx_v_sm->A);
6690 if (__pyx_t_3 < 0) {
6691 __pyx_t_3 += __pyx_v_R.shape[0];
6692 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6693 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6694 if (unlikely(__pyx_t_2 != -1)) {
6695 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6696 __PYX_ERR(0, 389, __pyx_L1_error)
6708 if (__pyx_t_4 < 0) {
6709 __pyx_t_4 += __pyx_v_node_order.shape[0];
6710 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6711 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6712 if (unlikely(__pyx_t_2 != -1)) {
6713 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6714 __PYX_ERR(0, 391, __pyx_L1_error)
6726 if (__pyx_t_5 < 0) {
6727 __pyx_t_5 += __pyx_v_dX.shape[0];
6728 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6729 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6730 if (unlikely(__pyx_t_2 != -1)) {
6731 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6732 __PYX_ERR(0, 393, __pyx_L1_error)
6742 basm_NR_solve(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_w, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_basmFactor->subdomain_R, (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_basmFactor->subdomain_dX, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6755 __Pyx_XDECREF(__pyx_t_1);
6756 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6758 __Pyx_RefNannyFinishContext();
6770 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
6771 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
6773 __Pyx_RefNannyDeclarations
6774 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
6775 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
6778 __Pyx_RefNannyFinishContext();
6782 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
6785 int __pyx_v_endian_detector;
6786 int __pyx_v_little_endian;
6789 PyArray_Descr *__pyx_v_descr = 0;
6792 __Pyx_RefNannyDeclarations
6795 PyObject *__pyx_t_3 = NULL;
6799 PyObject *__pyx_t_7 = NULL;
6801 if (__pyx_v_info == NULL) {
6802 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
6805 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
6806 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6807 __Pyx_GIVEREF(__pyx_v_info->obj);
6816 __pyx_v_endian_detector = 1;
6825 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
6834 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
6843 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
6846 __pyx_t_1 = __pyx_t_2;
6847 goto __pyx_L4_bool_binop_done;
6857 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
6858 __pyx_t_1 = __pyx_t_2;
6859 __pyx_L4_bool_binop_done:;
6868 if (unlikely(__pyx_t_1)) {
6877 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 229, __pyx_L1_error)
6878 __Pyx_GOTREF(__pyx_t_3);
6879 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6880 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6881 __PYX_ERR(2, 229, __pyx_L1_error)
6899 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
6902 __pyx_t_1 = __pyx_t_2;
6903 goto __pyx_L7_bool_binop_done;
6913 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
6914 __pyx_t_1 = __pyx_t_2;
6915 __pyx_L7_bool_binop_done:;
6924 if (unlikely(__pyx_t_1)) {
6933 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 233, __pyx_L1_error)
6934 __Pyx_GOTREF(__pyx_t_3);
6935 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6936 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6937 __PYX_ERR(2, 233, __pyx_L1_error)
6955 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
6964 __pyx_v_info->ndim = __pyx_v_ndim;
6973 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
6983 __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
6992 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
7001 __pyx_t_4 = __pyx_v_ndim;
7002 __pyx_t_5 = __pyx_t_4;
7003 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
7004 __pyx_v_i = __pyx_t_6;
7013 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
7022 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
7043 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
7052 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
7063 __pyx_v_info->suboffsets = NULL;
7072 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
7081 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
7099 __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
7100 __Pyx_INCREF(__pyx_t_3);
7101 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
7111 __Pyx_INCREF(((PyObject *)__pyx_v_self));
7112 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7113 __Pyx_GOTREF(__pyx_v_info->obj);
7114 __Pyx_DECREF(__pyx_v_info->obj);
7115 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7124 __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
7134 __pyx_t_4 = __pyx_v_descr->type_num;
7135 __pyx_v_t = __pyx_t_4;
7144 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'>') != 0);
7146 goto __pyx_L15_next_or;
7149 __pyx_t_2 = (__pyx_v_little_endian != 0);
7152 __pyx_t_1 = __pyx_t_2;
7153 goto __pyx_L14_bool_binop_done;
7164 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'<') != 0);
7167 __pyx_t_1 = __pyx_t_2;
7168 goto __pyx_L14_bool_binop_done;
7170 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
7171 __pyx_t_1 = __pyx_t_2;
7172 __pyx_L14_bool_binop_done:;
7181 if (unlikely(__pyx_t_1)) {
7190 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 263, __pyx_L1_error)
7191 __Pyx_GOTREF(__pyx_t_3);
7192 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7193 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7194 __PYX_ERR(2, 263, __pyx_L1_error)
7212 switch (__pyx_v_t) {
7214 __pyx_v_f = ((
char *)
"b");
7225 __pyx_v_f = ((
char *)
"B");
7236 __pyx_v_f = ((
char *)
"h");
7247 __pyx_v_f = ((
char *)
"H");
7258 __pyx_v_f = ((
char *)
"i");
7269 __pyx_v_f = ((
char *)
"I");
7280 __pyx_v_f = ((
char *)
"l");
7291 __pyx_v_f = ((
char *)
"L");
7302 __pyx_v_f = ((
char *)
"q");
7313 __pyx_v_f = ((
char *)
"Q");
7324 __pyx_v_f = ((
char *)
"f");
7335 __pyx_v_f = ((
char *)
"d");
7345 case NPY_LONGDOUBLE:
7346 __pyx_v_f = ((
char *)
"g");
7357 __pyx_v_f = ((
char *)
"Zf");
7368 __pyx_v_f = ((
char *)
"Zd");
7378 case NPY_CLONGDOUBLE:
7379 __pyx_v_f = ((
char *)
"Zg");
7390 __pyx_v_f = ((
char *)
"O");
7401 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 282, __pyx_L1_error)
7402 __Pyx_GOTREF(__pyx_t_3);
7403 __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3);
if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 282, __pyx_L1_error)
7404 __Pyx_GOTREF(__pyx_t_7);
7405 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7406 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 282, __pyx_L1_error)
7407 __Pyx_GOTREF(__pyx_t_3);
7408 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7409 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7410 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7411 __PYX_ERR(2, 282, __pyx_L1_error)
7422 __pyx_v_info->format = __pyx_v_f;
7451 __pyx_v_info->format = ((
char *)PyObject_Malloc(0xFF));
7460 (__pyx_v_info->format[0]) =
'^';
7478 __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset));
if (unlikely(__pyx_t_8 == ((
char *)NULL))) __PYX_ERR(2, 289, __pyx_L1_error)
7479 __pyx_v_f = __pyx_t_8;
7488 (__pyx_v_f[0]) =
'\x00';
7503 __Pyx_XDECREF(__pyx_t_3);
7504 __Pyx_XDECREF(__pyx_t_7);
7505 __Pyx_AddTraceback(
"numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7507 if (__pyx_v_info->obj != NULL) {
7508 __Pyx_GOTREF(__pyx_v_info->obj);
7509 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7513 if (__pyx_v_info->obj == Py_None) {
7514 __Pyx_GOTREF(__pyx_v_info->obj);
7515 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7518 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
7519 __Pyx_RefNannyFinishContext();
7532 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info);
7533 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7534 __Pyx_RefNannyDeclarations
7535 __Pyx_RefNannySetupContext(
"__releasebuffer__ (wrapper)", 0);
7536 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
7539 __Pyx_RefNannyFinishContext();
7542 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7543 __Pyx_RefNannyDeclarations
7545 __Pyx_RefNannySetupContext(
"__releasebuffer__", 0);
7554 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
7564 PyObject_Free(__pyx_v_info->format);
7582 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
7592 PyObject_Free(__pyx_v_info->strides);
7612 __Pyx_RefNannyFinishContext();
7623 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7624 PyObject *__pyx_r = NULL;
7625 __Pyx_RefNannyDeclarations
7626 PyObject *__pyx_t_1 = NULL;
7627 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
7636 __Pyx_XDECREF(__pyx_r);
7637 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 776, __pyx_L1_error)
7638 __Pyx_GOTREF(__pyx_t_1);
7639 __pyx_r = __pyx_t_1;
7653 __Pyx_XDECREF(__pyx_t_1);
7654 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7657 __Pyx_XGIVEREF(__pyx_r);
7658 __Pyx_RefNannyFinishContext();
7670 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7671 PyObject *__pyx_r = NULL;
7672 __Pyx_RefNannyDeclarations
7673 PyObject *__pyx_t_1 = NULL;
7674 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
7683 __Pyx_XDECREF(__pyx_r);
7684 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 779, __pyx_L1_error)
7685 __Pyx_GOTREF(__pyx_t_1);
7686 __pyx_r = __pyx_t_1;
7700 __Pyx_XDECREF(__pyx_t_1);
7701 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7704 __Pyx_XGIVEREF(__pyx_r);
7705 __Pyx_RefNannyFinishContext();
7717 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7718 PyObject *__pyx_r = NULL;
7719 __Pyx_RefNannyDeclarations
7720 PyObject *__pyx_t_1 = NULL;
7721 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
7730 __Pyx_XDECREF(__pyx_r);
7731 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 782, __pyx_L1_error)
7732 __Pyx_GOTREF(__pyx_t_1);
7733 __pyx_r = __pyx_t_1;
7747 __Pyx_XDECREF(__pyx_t_1);
7748 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7751 __Pyx_XGIVEREF(__pyx_r);
7752 __Pyx_RefNannyFinishContext();
7764 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
7765 PyObject *__pyx_r = NULL;
7766 __Pyx_RefNannyDeclarations
7767 PyObject *__pyx_t_1 = NULL;
7768 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
7777 __Pyx_XDECREF(__pyx_r);
7778 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 785, __pyx_L1_error)
7779 __Pyx_GOTREF(__pyx_t_1);
7780 __pyx_r = __pyx_t_1;
7794 __Pyx_XDECREF(__pyx_t_1);
7795 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7798 __Pyx_XGIVEREF(__pyx_r);
7799 __Pyx_RefNannyFinishContext();
7811 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7812 PyObject *__pyx_r = NULL;
7813 __Pyx_RefNannyDeclarations
7814 PyObject *__pyx_t_1 = NULL;
7815 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
7824 __Pyx_XDECREF(__pyx_r);
7825 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 788, __pyx_L1_error)
7826 __Pyx_GOTREF(__pyx_t_1);
7827 __pyx_r = __pyx_t_1;
7841 __Pyx_XDECREF(__pyx_t_1);
7842 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7845 __Pyx_XGIVEREF(__pyx_r);
7846 __Pyx_RefNannyFinishContext();
7858 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7859 PyObject *__pyx_r = NULL;
7860 __Pyx_RefNannyDeclarations
7862 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
7871 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7881 __Pyx_XDECREF(__pyx_r);
7882 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7883 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7903 __Pyx_XDECREF(__pyx_r);
7904 __Pyx_INCREF(__pyx_empty_tuple);
7905 __pyx_r = __pyx_empty_tuple;
7919 __Pyx_XGIVEREF(__pyx_r);
7920 __Pyx_RefNannyFinishContext();
7932 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr,
char *__pyx_v_f,
char *__pyx_v_end,
int *__pyx_v_offset) {
7933 PyArray_Descr *__pyx_v_child = 0;
7934 int __pyx_v_endian_detector;
7935 int __pyx_v_little_endian;
7936 PyObject *__pyx_v_fields = 0;
7937 PyObject *__pyx_v_childname = NULL;
7938 PyObject *__pyx_v_new_offset = NULL;
7939 PyObject *__pyx_v_t = NULL;
7941 __Pyx_RefNannyDeclarations
7942 PyObject *__pyx_t_1 = NULL;
7943 Py_ssize_t __pyx_t_2;
7944 PyObject *__pyx_t_3 = NULL;
7945 PyObject *__pyx_t_4 = NULL;
7951 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
7960 __pyx_v_endian_detector = 1;
7969 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
7978 if (unlikely(__pyx_v_descr->names == Py_None)) {
7979 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
7980 __PYX_ERR(2, 805, __pyx_L1_error)
7982 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
7984 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
7985 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7986 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(2, 805, __pyx_L1_error)
7988 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 805, __pyx_L1_error)
7989 __Pyx_GOTREF(__pyx_t_3);
7991 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
8001 if (unlikely(__pyx_v_descr->fields == Py_None)) {
8002 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8003 __PYX_ERR(2, 806, __pyx_L1_error)
8005 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 806, __pyx_L1_error)
8006 __Pyx_GOTREF(__pyx_t_3);
8007 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 806, __pyx_L1_error)
8008 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
8018 if (likely(__pyx_v_fields != Py_None)) {
8019 PyObject* sequence = __pyx_v_fields;
8020 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8021 if (unlikely(size != 2)) {
8022 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8023 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8024 __PYX_ERR(2, 807, __pyx_L1_error)
8026 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8027 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
8028 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
8029 __Pyx_INCREF(__pyx_t_3);
8030 __Pyx_INCREF(__pyx_t_4);
8032 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 807, __pyx_L1_error)
8033 __Pyx_GOTREF(__pyx_t_3);
8034 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 807, __pyx_L1_error)
8035 __Pyx_GOTREF(__pyx_t_4);
8038 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 807, __pyx_L1_error)
8040 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 807, __pyx_L1_error)
8041 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
8043 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
8053 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 809, __pyx_L1_error)
8054 __Pyx_GOTREF(__pyx_t_4);
8055 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 809, __pyx_L1_error)
8056 __Pyx_GOTREF(__pyx_t_3);
8057 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8058 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 809, __pyx_L1_error)
8059 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8060 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((
int)__pyx_t_5)) < 15) != 0);
8061 if (unlikely(__pyx_t_6)) {
8070 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 810, __pyx_L1_error)
8071 __Pyx_GOTREF(__pyx_t_3);
8072 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8073 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8074 __PYX_ERR(2, 810, __pyx_L1_error)
8092 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'>') != 0);
8094 goto __pyx_L8_next_or;
8097 __pyx_t_7 = (__pyx_v_little_endian != 0);
8100 __pyx_t_6 = __pyx_t_7;
8101 goto __pyx_L7_bool_binop_done;
8112 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'<') != 0);
8115 __pyx_t_6 = __pyx_t_7;
8116 goto __pyx_L7_bool_binop_done;
8118 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
8119 __pyx_t_6 = __pyx_t_7;
8120 __pyx_L7_bool_binop_done:;
8129 if (unlikely(__pyx_t_6)) {
8138 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 814, __pyx_L1_error)
8139 __Pyx_GOTREF(__pyx_t_3);
8140 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8141 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8142 __PYX_ERR(2, 814, __pyx_L1_error)
8161 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 824, __pyx_L1_error)
8162 __Pyx_GOTREF(__pyx_t_3);
8163 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 824, __pyx_L1_error)
8164 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8165 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 824, __pyx_L1_error)
8166 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8167 if (!__pyx_t_6)
break;
8176 (__pyx_v_f[0]) = 0x78;
8185 __pyx_v_f = (__pyx_v_f + 1);
8195 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
8206 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
8215 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
8225 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error)
8226 __Pyx_GOTREF(__pyx_t_4);
8227 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
8237 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
8238 if (unlikely(__pyx_t_6)) {
8247 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error)
8248 __Pyx_GOTREF(__pyx_t_4);
8249 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8250 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8251 __PYX_ERR(2, 834, __pyx_L1_error)
8269 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error)
8270 __Pyx_GOTREF(__pyx_t_4);
8271 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error)
8272 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8273 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error)
8274 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8276 (__pyx_v_f[0]) = 98;
8287 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error)
8288 __Pyx_GOTREF(__pyx_t_3);
8289 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error)
8290 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8291 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error)
8292 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8294 (__pyx_v_f[0]) = 66;
8305 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error)
8306 __Pyx_GOTREF(__pyx_t_4);
8307 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error)
8308 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8309 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error)
8310 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8312 (__pyx_v_f[0]) = 0x68;
8323 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error)
8324 __Pyx_GOTREF(__pyx_t_3);
8325 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error)
8326 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8327 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error)
8328 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8330 (__pyx_v_f[0]) = 72;
8341 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error)
8342 __Pyx_GOTREF(__pyx_t_4);
8343 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error)
8344 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8345 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error)
8346 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8348 (__pyx_v_f[0]) = 0x69;
8359 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error)
8360 __Pyx_GOTREF(__pyx_t_3);
8361 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error)
8362 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8363 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error)
8364 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8366 (__pyx_v_f[0]) = 73;
8377 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 843, __pyx_L1_error)
8378 __Pyx_GOTREF(__pyx_t_4);
8379 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 843, __pyx_L1_error)
8380 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8381 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 843, __pyx_L1_error)
8382 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8384 (__pyx_v_f[0]) = 0x6C;
8395 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error)
8396 __Pyx_GOTREF(__pyx_t_3);
8397 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __pyx_L1_error)
8398 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8399 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 844, __pyx_L1_error)
8400 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8402 (__pyx_v_f[0]) = 76;
8413 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 845, __pyx_L1_error)
8414 __Pyx_GOTREF(__pyx_t_4);
8415 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 845, __pyx_L1_error)
8416 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8417 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 845, __pyx_L1_error)
8418 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8420 (__pyx_v_f[0]) = 0x71;
8431 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 846, __pyx_L1_error)
8432 __Pyx_GOTREF(__pyx_t_3);
8433 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 846, __pyx_L1_error)
8434 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8435 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 846, __pyx_L1_error)
8436 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8438 (__pyx_v_f[0]) = 81;
8449 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 847, __pyx_L1_error)
8450 __Pyx_GOTREF(__pyx_t_4);
8451 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 847, __pyx_L1_error)
8452 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8453 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 847, __pyx_L1_error)
8454 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8456 (__pyx_v_f[0]) = 0x66;
8467 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 848, __pyx_L1_error)
8468 __Pyx_GOTREF(__pyx_t_3);
8469 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 848, __pyx_L1_error)
8470 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8471 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 848, __pyx_L1_error)
8472 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8474 (__pyx_v_f[0]) = 0x64;
8485 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 849, __pyx_L1_error)
8486 __Pyx_GOTREF(__pyx_t_4);
8487 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 849, __pyx_L1_error)
8488 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8489 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 849, __pyx_L1_error)
8490 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8492 (__pyx_v_f[0]) = 0x67;
8503 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 850, __pyx_L1_error)
8504 __Pyx_GOTREF(__pyx_t_3);
8505 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 850, __pyx_L1_error)
8506 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8507 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 850, __pyx_L1_error)
8508 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8510 (__pyx_v_f[0]) = 90;
8511 (__pyx_v_f[1]) = 0x66;
8512 __pyx_v_f = (__pyx_v_f + 1);
8523 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 851, __pyx_L1_error)
8524 __Pyx_GOTREF(__pyx_t_4);
8525 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 851, __pyx_L1_error)
8526 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8527 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 851, __pyx_L1_error)
8528 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8530 (__pyx_v_f[0]) = 90;
8531 (__pyx_v_f[1]) = 0x64;
8532 __pyx_v_f = (__pyx_v_f + 1);
8543 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 852, __pyx_L1_error)
8544 __Pyx_GOTREF(__pyx_t_3);
8545 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 852, __pyx_L1_error)
8546 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8547 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 852, __pyx_L1_error)
8548 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8550 (__pyx_v_f[0]) = 90;
8551 (__pyx_v_f[1]) = 0x67;
8552 __pyx_v_f = (__pyx_v_f + 1);
8563 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
8564 __Pyx_GOTREF(__pyx_t_4);
8565 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
8566 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8567 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 853, __pyx_L1_error)
8568 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8569 if (likely(__pyx_t_6)) {
8570 (__pyx_v_f[0]) = 79;
8582 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
8583 __Pyx_GOTREF(__pyx_t_3);
8584 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
8585 __Pyx_GOTREF(__pyx_t_4);
8586 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8587 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8588 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8589 __PYX_ERR(2, 855, __pyx_L1_error)
8600 __pyx_v_f = (__pyx_v_f + 1);
8620 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset);
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(2, 860, __pyx_L1_error)
8621 __pyx_v_f = __pyx_t_9;
8633 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8642 __pyx_r = __pyx_v_f;
8655 __Pyx_XDECREF(__pyx_t_1);
8656 __Pyx_XDECREF(__pyx_t_3);
8657 __Pyx_XDECREF(__pyx_t_4);
8658 __Pyx_AddTraceback(
"numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
8661 __Pyx_XDECREF((PyObject *)__pyx_v_child);
8662 __Pyx_XDECREF(__pyx_v_fields);
8663 __Pyx_XDECREF(__pyx_v_childname);
8664 __Pyx_XDECREF(__pyx_v_new_offset);
8665 __Pyx_XDECREF(__pyx_v_t);
8666 __Pyx_RefNannyFinishContext();
8678 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
8679 PyObject *__pyx_v_baseptr;
8680 __Pyx_RefNannyDeclarations
8683 __Pyx_RefNannySetupContext(
"set_array_base", 0);
8692 __pyx_t_1 = (__pyx_v_base == Py_None);
8693 __pyx_t_2 = (__pyx_t_1 != 0);
8703 __pyx_v_baseptr = NULL;
8723 Py_INCREF(__pyx_v_base);
8732 __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
8743 Py_XDECREF(__pyx_v_arr->base);
8752 __pyx_v_arr->base = __pyx_v_baseptr;
8763 __Pyx_RefNannyFinishContext();
8774 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
8775 PyObject *__pyx_r = NULL;
8776 __Pyx_RefNannyDeclarations
8778 __Pyx_RefNannySetupContext(
"get_array_base", 0);
8787 __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
8797 __Pyx_XDECREF(__pyx_r);
8798 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8818 __Pyx_XDECREF(__pyx_r);
8819 __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
8820 __pyx_r = ((PyObject *)__pyx_v_arr->base);
8834 __Pyx_XGIVEREF(__pyx_r);
8835 __Pyx_RefNannyFinishContext();
8847 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
8849 __Pyx_RefNannyDeclarations
8850 PyObject *__pyx_t_1 = NULL;
8851 PyObject *__pyx_t_2 = NULL;
8852 PyObject *__pyx_t_3 = NULL;
8854 PyObject *__pyx_t_5 = NULL;
8855 PyObject *__pyx_t_6 = NULL;
8856 PyObject *__pyx_t_7 = NULL;
8857 PyObject *__pyx_t_8 = NULL;
8858 __Pyx_RefNannySetupContext(
"import_array", 0);
8868 __Pyx_PyThreadState_declare
8869 __Pyx_PyThreadState_assign
8870 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8871 __Pyx_XGOTREF(__pyx_t_1);
8872 __Pyx_XGOTREF(__pyx_t_2);
8873 __Pyx_XGOTREF(__pyx_t_3);
8883 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 998, __pyx_L3_error)
8893 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8894 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8895 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8896 goto __pyx_L8_try_end;
8906 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8908 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8909 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 999, __pyx_L5_except_error)
8910 __Pyx_GOTREF(__pyx_t_5);
8911 __Pyx_GOTREF(__pyx_t_6);
8912 __Pyx_GOTREF(__pyx_t_7);
8921 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1000, __pyx_L5_except_error)
8922 __Pyx_GOTREF(__pyx_t_8);
8923 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8924 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8925 __PYX_ERR(2, 1000, __pyx_L5_except_error)
8927 goto __pyx_L5_except_error;
8928 __pyx_L5_except_error:;
8937 __Pyx_XGIVEREF(__pyx_t_1);
8938 __Pyx_XGIVEREF(__pyx_t_2);
8939 __Pyx_XGIVEREF(__pyx_t_3);
8940 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8941 goto __pyx_L1_error;
8957 __Pyx_XDECREF(__pyx_t_5);
8958 __Pyx_XDECREF(__pyx_t_6);
8959 __Pyx_XDECREF(__pyx_t_7);
8960 __Pyx_XDECREF(__pyx_t_8);
8961 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8964 __Pyx_RefNannyFinishContext();
8976 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
8978 __Pyx_RefNannyDeclarations
8979 PyObject *__pyx_t_1 = NULL;
8980 PyObject *__pyx_t_2 = NULL;
8981 PyObject *__pyx_t_3 = NULL;
8983 PyObject *__pyx_t_5 = NULL;
8984 PyObject *__pyx_t_6 = NULL;
8985 PyObject *__pyx_t_7 = NULL;
8986 PyObject *__pyx_t_8 = NULL;
8987 __Pyx_RefNannySetupContext(
"import_umath", 0);
8997 __Pyx_PyThreadState_declare
8998 __Pyx_PyThreadState_assign
8999 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9000 __Pyx_XGOTREF(__pyx_t_1);
9001 __Pyx_XGOTREF(__pyx_t_2);
9002 __Pyx_XGOTREF(__pyx_t_3);
9012 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1004, __pyx_L3_error)
9022 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9023 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9024 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9025 goto __pyx_L8_try_end;
9035 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
9037 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
9038 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1005, __pyx_L5_except_error)
9039 __Pyx_GOTREF(__pyx_t_5);
9040 __Pyx_GOTREF(__pyx_t_6);
9041 __Pyx_GOTREF(__pyx_t_7);
9050 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1006, __pyx_L5_except_error)
9051 __Pyx_GOTREF(__pyx_t_8);
9052 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
9053 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9054 __PYX_ERR(2, 1006, __pyx_L5_except_error)
9056 goto __pyx_L5_except_error;
9057 __pyx_L5_except_error:;
9066 __Pyx_XGIVEREF(__pyx_t_1);
9067 __Pyx_XGIVEREF(__pyx_t_2);
9068 __Pyx_XGIVEREF(__pyx_t_3);
9069 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
9070 goto __pyx_L1_error;
9086 __Pyx_XDECREF(__pyx_t_5);
9087 __Pyx_XDECREF(__pyx_t_6);
9088 __Pyx_XDECREF(__pyx_t_7);
9089 __Pyx_XDECREF(__pyx_t_8);
9090 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
9093 __Pyx_RefNannyFinishContext();
9105 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
9107 __Pyx_RefNannyDeclarations
9108 PyObject *__pyx_t_1 = NULL;
9109 PyObject *__pyx_t_2 = NULL;
9110 PyObject *__pyx_t_3 = NULL;
9112 PyObject *__pyx_t_5 = NULL;
9113 PyObject *__pyx_t_6 = NULL;
9114 PyObject *__pyx_t_7 = NULL;
9115 PyObject *__pyx_t_8 = NULL;
9116 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
9126 __Pyx_PyThreadState_declare
9127 __Pyx_PyThreadState_assign
9128 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9129 __Pyx_XGOTREF(__pyx_t_1);
9130 __Pyx_XGOTREF(__pyx_t_2);
9131 __Pyx_XGOTREF(__pyx_t_3);
9141 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1010, __pyx_L3_error)
9151 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9152 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9153 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9154 goto __pyx_L8_try_end;
9163 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
9165 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
9166 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1011, __pyx_L5_except_error)
9167 __Pyx_GOTREF(__pyx_t_5);
9168 __Pyx_GOTREF(__pyx_t_6);
9169 __Pyx_GOTREF(__pyx_t_7);
9176 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1012, __pyx_L5_except_error)
9177 __Pyx_GOTREF(__pyx_t_8);
9178 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
9179 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9180 __PYX_ERR(2, 1012, __pyx_L5_except_error)
9182 goto __pyx_L5_except_error;
9183 __pyx_L5_except_error:;
9192 __Pyx_XGIVEREF(__pyx_t_1);
9193 __Pyx_XGIVEREF(__pyx_t_2);
9194 __Pyx_XGIVEREF(__pyx_t_3);
9195 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
9196 goto __pyx_L1_error;
9212 __Pyx_XDECREF(__pyx_t_5);
9213 __Pyx_XDECREF(__pyx_t_6);
9214 __Pyx_XDECREF(__pyx_t_7);
9215 __Pyx_XDECREF(__pyx_t_8);
9216 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
9219 __Pyx_RefNannyFinishContext();
9232 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9233 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9234 PyObject *__pyx_v_shape = 0;
9235 Py_ssize_t __pyx_v_itemsize;
9236 PyObject *__pyx_v_format = 0;
9237 PyObject *__pyx_v_mode = 0;
9238 int __pyx_v_allocate_buffer;
9240 __Pyx_RefNannyDeclarations
9241 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
9243 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
9244 PyObject* values[5] = {0,0,0,0,0};
9245 values[3] = ((PyObject *)__pyx_n_s_c);
9246 if (unlikely(__pyx_kwds)) {
9248 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9250 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9252 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9254 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9256 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9258 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9261 default:
goto __pyx_L5_argtuple_error;
9263 kw_args = PyDict_Size(__pyx_kwds);
9266 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
9267 else goto __pyx_L5_argtuple_error;
9270 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
9272 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 121, __pyx_L3_error)
9276 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
9278 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 121, __pyx_L3_error)
9283 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
9284 if (value) { values[3] = value; kw_args--; }
9289 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
9290 if (value) { values[4] = value; kw_args--; }
9293 if (unlikely(kw_args > 0)) {
9294 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 121, __pyx_L3_error)
9297 switch (PyTuple_GET_SIZE(__pyx_args)) {
9298 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9300 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9302 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9303 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9304 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9306 default:
goto __pyx_L5_argtuple_error;
9309 __pyx_v_shape = ((PyObject*)values[0]);
9310 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error)
9311 __pyx_v_format = values[2];
9312 __pyx_v_mode = values[3];
9314 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
9324 __pyx_v_allocate_buffer = ((int)1);
9327 goto __pyx_L4_argument_unpacking_done;
9328 __pyx_L5_argtuple_error:;
9329 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 121, __pyx_L3_error)
9331 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9332 __Pyx_RefNannyFinishContext();
9334 __pyx_L4_argument_unpacking_done:;
9335 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 121, __pyx_L1_error)
9336 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
9337 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 121, __pyx_L1_error)
9339 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
9354 __Pyx_RefNannyFinishContext();
9358 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
9360 Py_ssize_t __pyx_v_i;
9361 Py_ssize_t __pyx_v_dim;
9362 PyObject **__pyx_v_p;
9365 __Pyx_RefNannyDeclarations
9366 Py_ssize_t __pyx_t_1;
9368 PyObject *__pyx_t_3 = NULL;
9370 PyObject *__pyx_t_5 = NULL;
9373 Py_ssize_t __pyx_t_8;
9374 PyObject *__pyx_t_9 = NULL;
9375 PyObject *__pyx_t_10 = NULL;
9376 Py_ssize_t __pyx_t_11;
9377 __Pyx_RefNannySetupContext(
"__cinit__", 0);
9378 __Pyx_INCREF(__pyx_v_format);
9387 if (unlikely(__pyx_v_shape == Py_None)) {
9388 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
9389 __PYX_ERR(1, 128, __pyx_L1_error)
9391 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 128, __pyx_L1_error)
9392 __pyx_v_self->ndim = ((int)__pyx_t_1);
9401 __pyx_v_self->itemsize = __pyx_v_itemsize;
9410 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
9411 if (unlikely(__pyx_t_2)) {
9420 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 132, __pyx_L1_error)
9421 __Pyx_GOTREF(__pyx_t_3);
9422 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9423 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9424 __PYX_ERR(1, 132, __pyx_L1_error)
9442 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
9443 if (unlikely(__pyx_t_2)) {
9452 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 135, __pyx_L1_error)
9453 __Pyx_GOTREF(__pyx_t_3);
9454 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9455 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9456 __PYX_ERR(1, 135, __pyx_L1_error)
9474 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
9475 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
9485 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 138, __pyx_L1_error)
9486 __Pyx_GOTREF(__pyx_t_3);
9487 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 138, __pyx_L1_error)
9488 __Pyx_GOTREF(__pyx_t_5);
9489 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9490 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
9509 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 139, __pyx_L1_error)
9510 __pyx_t_5 = __pyx_v_format;
9511 __Pyx_INCREF(__pyx_t_5);
9512 __Pyx_GIVEREF(__pyx_t_5);
9513 __Pyx_GOTREF(__pyx_v_self->_format);
9514 __Pyx_DECREF(__pyx_v_self->_format);
9515 __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
9525 if (unlikely(__pyx_v_self->_format == Py_None)) {
9526 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
9527 __PYX_ERR(1, 140, __pyx_L1_error)
9529 __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 140, __pyx_L1_error)
9530 __pyx_v_self->format = __pyx_t_6;
9539 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
9548 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
9557 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
9558 if (unlikely(__pyx_t_4)) {
9567 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 147, __pyx_L1_error)
9568 __Pyx_GOTREF(__pyx_t_5);
9569 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
9570 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9571 __PYX_ERR(1, 147, __pyx_L1_error)
9590 __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
9592 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
9593 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9594 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 150, __pyx_L1_error)
9596 __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 150, __pyx_L1_error)
9597 __Pyx_GOTREF(__pyx_t_3);
9599 __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 150, __pyx_L1_error)
9600 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9601 __pyx_v_dim = __pyx_t_8;
9602 __pyx_v_idx = __pyx_t_7;
9603 __pyx_t_7 = (__pyx_t_7 + 1);
9612 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
9613 if (unlikely(__pyx_t_4)) {
9622 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 152, __pyx_L1_error)
9623 __Pyx_GOTREF(__pyx_t_3);
9624 __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error)
9625 __Pyx_GOTREF(__pyx_t_9);
9626 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error)
9627 __Pyx_GOTREF(__pyx_t_10);
9628 __Pyx_GIVEREF(__pyx_t_3);
9629 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
9630 __Pyx_GIVEREF(__pyx_t_9);
9631 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
9634 __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error)
9635 __Pyx_GOTREF(__pyx_t_9);
9636 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9637 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error)
9638 __Pyx_GOTREF(__pyx_t_10);
9639 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9640 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9641 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9642 __PYX_ERR(1, 152, __pyx_L1_error)
9660 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
9670 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9679 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 156, __pyx_L1_error)
9689 __pyx_v_order =
'F';
9698 __Pyx_INCREF(__pyx_n_u_fortran);
9699 __Pyx_GIVEREF(__pyx_n_u_fortran);
9700 __Pyx_GOTREF(__pyx_v_self->mode);
9701 __Pyx_DECREF(__pyx_v_self->mode);
9702 __pyx_v_self->mode = __pyx_n_u_fortran;
9721 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 159, __pyx_L1_error)
9722 if (likely(__pyx_t_4)) {
9731 __pyx_v_order =
'C';
9740 __Pyx_INCREF(__pyx_n_u_c);
9741 __Pyx_GIVEREF(__pyx_n_u_c);
9742 __Pyx_GOTREF(__pyx_v_self->mode);
9743 __Pyx_DECREF(__pyx_v_self->mode);
9744 __pyx_v_self->mode = __pyx_n_u_c;
9764 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error)
9765 __Pyx_GOTREF(__pyx_t_5);
9766 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 163, __pyx_L1_error)
9767 __Pyx_GOTREF(__pyx_t_10);
9768 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9769 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9770 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9771 __PYX_ERR(1, 163, __pyx_L1_error)
9782 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
9791 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
9800 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 169, __pyx_L1_error)
9801 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 169, __pyx_L1_error)
9802 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9803 __pyx_v_self->dtype_is_object = __pyx_t_4;
9812 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
9822 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
9831 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
9832 if (unlikely(__pyx_t_4)) {
9841 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 175, __pyx_L1_error)
9842 __Pyx_GOTREF(__pyx_t_10);
9843 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9844 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9845 __PYX_ERR(1, 175, __pyx_L1_error)
9863 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
9873 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
9882 if (unlikely(__pyx_v_itemsize == 0)) {
9883 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
9884 __PYX_ERR(1, 179, __pyx_L1_error)
9886 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
9887 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
9888 __PYX_ERR(1, 179, __pyx_L1_error)
9890 __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
9891 __pyx_t_8 = __pyx_t_1;
9892 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) {
9893 __pyx_v_i = __pyx_t_11;
9902 (__pyx_v_p[__pyx_v_i]) = Py_None;
9944 __Pyx_XDECREF(__pyx_t_3);
9945 __Pyx_XDECREF(__pyx_t_5);
9946 __Pyx_XDECREF(__pyx_t_9);
9947 __Pyx_XDECREF(__pyx_t_10);
9948 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9951 __Pyx_XDECREF(__pyx_v_format);
9952 __Pyx_RefNannyFinishContext();
9965 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
9966 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
9968 __Pyx_RefNannyDeclarations
9969 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
9970 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
9973 __Pyx_RefNannyFinishContext();
9977 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
9978 int __pyx_v_bufmode;
9980 __Pyx_RefNannyDeclarations
9983 PyObject *__pyx_t_3 = NULL;
9985 Py_ssize_t __pyx_t_5;
9987 Py_ssize_t *__pyx_t_7;
9988 if (__pyx_v_info == NULL) {
9989 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
9992 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
9993 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9994 __Pyx_GIVEREF(__pyx_v_info->obj);
10003 __pyx_v_bufmode = -1;
10012 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 186, __pyx_L1_error)
10013 __pyx_t_2 = (__pyx_t_1 != 0);
10023 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
10042 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
10043 __pyx_t_1 = (__pyx_t_2 != 0);
10053 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
10072 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
10073 if (unlikely(__pyx_t_1)) {
10082 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 191, __pyx_L1_error)
10083 __Pyx_GOTREF(__pyx_t_3);
10084 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10085 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10086 __PYX_ERR(1, 191, __pyx_L1_error)
10104 __pyx_t_4 = __pyx_v_self->data;
10105 __pyx_v_info->buf = __pyx_t_4;
10114 __pyx_t_5 = __pyx_v_self->len;
10115 __pyx_v_info->len = __pyx_t_5;
10124 __pyx_t_6 = __pyx_v_self->ndim;
10125 __pyx_v_info->ndim = __pyx_t_6;
10134 __pyx_t_7 = __pyx_v_self->_shape;
10135 __pyx_v_info->shape = __pyx_t_7;
10144 __pyx_t_7 = __pyx_v_self->_strides;
10145 __pyx_v_info->strides = __pyx_t_7;
10154 __pyx_v_info->suboffsets = NULL;
10163 __pyx_t_5 = __pyx_v_self->itemsize;
10164 __pyx_v_info->itemsize = __pyx_t_5;
10173 __pyx_v_info->readonly = 0;
10182 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10192 __pyx_t_4 = __pyx_v_self->format;
10193 __pyx_v_info->format = __pyx_t_4;
10213 __pyx_v_info->format = NULL;
10224 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10225 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10226 __Pyx_GOTREF(__pyx_v_info->obj);
10227 __Pyx_DECREF(__pyx_v_info->obj);
10228 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10242 __Pyx_XDECREF(__pyx_t_3);
10243 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10245 if (__pyx_v_info->obj != NULL) {
10246 __Pyx_GOTREF(__pyx_v_info->obj);
10247 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10251 if (__pyx_v_info->obj == Py_None) {
10252 __Pyx_GOTREF(__pyx_v_info->obj);
10253 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10256 __Pyx_RefNannyFinishContext();
10269 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
10270 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
10271 __Pyx_RefNannyDeclarations
10272 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
10273 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
10276 __Pyx_RefNannyFinishContext();
10279 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
10280 __Pyx_RefNannyDeclarations
10282 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
10291 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
10301 __pyx_v_self->callback_free_data(__pyx_v_self->data);
10320 __pyx_t_1 = (__pyx_v_self->free_data != 0);
10330 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
10340 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
10358 free(__pyx_v_self->data);
10377 PyObject_Free(__pyx_v_self->_shape);
10388 __Pyx_RefNannyFinishContext();
10400 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
10401 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
10402 PyObject *__pyx_r = 0;
10403 __Pyx_RefNannyDeclarations
10404 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
10405 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
10408 __Pyx_RefNannyFinishContext();
10412 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
10413 PyObject *__pyx_r = NULL;
10414 __Pyx_RefNannyDeclarations
10415 PyObject *__pyx_t_1 = NULL;
10416 __Pyx_RefNannySetupContext(
"__get__", 0);
10425 __Pyx_XDECREF(__pyx_r);
10426 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 222, __pyx_L1_error)
10427 __Pyx_GOTREF(__pyx_t_1);
10428 __pyx_r = __pyx_t_1;
10442 __Pyx_XDECREF(__pyx_t_1);
10443 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10446 __Pyx_XGIVEREF(__pyx_r);
10447 __Pyx_RefNannyFinishContext();
10459 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
10461 PyObject *__pyx_r = NULL;
10462 __Pyx_RefNannyDeclarations
10463 PyObject *__pyx_t_1 = NULL;
10464 PyObject *__pyx_t_2 = NULL;
10465 PyObject *__pyx_t_3 = NULL;
10466 __Pyx_RefNannySetupContext(
"get_memview", 0);
10475 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
10484 __Pyx_XDECREF(__pyx_r);
10485 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 227, __pyx_L1_error)
10486 __Pyx_GOTREF(__pyx_t_1);
10487 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error)
10488 __Pyx_GOTREF(__pyx_t_2);
10489 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 227, __pyx_L1_error)
10490 __Pyx_GOTREF(__pyx_t_3);
10491 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10492 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10493 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
10494 __Pyx_GIVEREF(__pyx_t_1);
10495 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
10496 __Pyx_GIVEREF(__pyx_t_2);
10497 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
10500 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error)
10501 __Pyx_GOTREF(__pyx_t_2);
10502 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10503 __pyx_r = __pyx_t_2;
10517 __Pyx_XDECREF(__pyx_t_1);
10518 __Pyx_XDECREF(__pyx_t_2);
10519 __Pyx_XDECREF(__pyx_t_3);
10520 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
10523 __Pyx_XGIVEREF(__pyx_r);
10524 __Pyx_RefNannyFinishContext();
10537 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
10538 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
10539 Py_ssize_t __pyx_r;
10540 __Pyx_RefNannyDeclarations
10541 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
10542 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
10545 __Pyx_RefNannyFinishContext();
10549 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
10550 Py_ssize_t __pyx_r;
10551 __Pyx_RefNannyDeclarations
10552 __Pyx_RefNannySetupContext(
"__len__", 0);
10561 __pyx_r = (__pyx_v_self->_shape[0]);
10574 __Pyx_RefNannyFinishContext();
10587 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
10588 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
10589 PyObject *__pyx_r = 0;
10590 __Pyx_RefNannyDeclarations
10591 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
10592 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
10595 __Pyx_RefNannyFinishContext();
10599 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
10600 PyObject *__pyx_r = NULL;
10601 __Pyx_RefNannyDeclarations
10602 PyObject *__pyx_t_1 = NULL;
10603 PyObject *__pyx_t_2 = NULL;
10604 __Pyx_RefNannySetupContext(
"__getattr__", 0);
10613 __Pyx_XDECREF(__pyx_r);
10614 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error)
10615 __Pyx_GOTREF(__pyx_t_1);
10616 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error)
10617 __Pyx_GOTREF(__pyx_t_2);
10618 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10619 __pyx_r = __pyx_t_2;
10633 __Pyx_XDECREF(__pyx_t_1);
10634 __Pyx_XDECREF(__pyx_t_2);
10635 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10638 __Pyx_XGIVEREF(__pyx_r);
10639 __Pyx_RefNannyFinishContext();
10652 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
10653 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
10654 PyObject *__pyx_r = 0;
10655 __Pyx_RefNannyDeclarations
10656 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
10657 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
10660 __Pyx_RefNannyFinishContext();
10664 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
10665 PyObject *__pyx_r = NULL;
10666 __Pyx_RefNannyDeclarations
10667 PyObject *__pyx_t_1 = NULL;
10668 PyObject *__pyx_t_2 = NULL;
10669 __Pyx_RefNannySetupContext(
"__getitem__", 0);
10678 __Pyx_XDECREF(__pyx_r);
10679 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
10680 __Pyx_GOTREF(__pyx_t_1);
10681 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 236, __pyx_L1_error)
10682 __Pyx_GOTREF(__pyx_t_2);
10683 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10684 __pyx_r = __pyx_t_2;
10698 __Pyx_XDECREF(__pyx_t_1);
10699 __Pyx_XDECREF(__pyx_t_2);
10700 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10703 __Pyx_XGIVEREF(__pyx_r);
10704 __Pyx_RefNannyFinishContext();
10717 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
10718 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10720 __Pyx_RefNannyDeclarations
10721 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
10722 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
10725 __Pyx_RefNannyFinishContext();
10729 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10731 __Pyx_RefNannyDeclarations
10732 PyObject *__pyx_t_1 = NULL;
10733 __Pyx_RefNannySetupContext(
"__setitem__", 0);
10742 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 239, __pyx_L1_error)
10743 __Pyx_GOTREF(__pyx_t_1);
10744 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 239, __pyx_L1_error)
10745 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10759 __Pyx_XDECREF(__pyx_t_1);
10760 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10763 __Pyx_RefNannyFinishContext();
10774 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10775 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10776 PyObject *__pyx_r = 0;
10777 __Pyx_RefNannyDeclarations
10778 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10779 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
10782 __Pyx_RefNannyFinishContext();
10786 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
10787 PyObject *__pyx_r = NULL;
10788 __Pyx_RefNannyDeclarations
10789 PyObject *__pyx_t_1 = NULL;
10790 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
10798 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
10799 __Pyx_GOTREF(__pyx_t_1);
10800 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10801 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10802 __PYX_ERR(1, 2, __pyx_L1_error)
10812 __Pyx_XDECREF(__pyx_t_1);
10813 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10815 __Pyx_XGIVEREF(__pyx_r);
10816 __Pyx_RefNannyFinishContext();
10828 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10829 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10830 PyObject *__pyx_r = 0;
10831 __Pyx_RefNannyDeclarations
10832 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10833 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10836 __Pyx_RefNannyFinishContext();
10840 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10841 PyObject *__pyx_r = NULL;
10842 __Pyx_RefNannyDeclarations
10843 PyObject *__pyx_t_1 = NULL;
10844 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10851 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10852 __Pyx_GOTREF(__pyx_t_1);
10853 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10854 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10855 __PYX_ERR(1, 4, __pyx_L1_error)
10866 __Pyx_XDECREF(__pyx_t_1);
10867 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10869 __Pyx_XGIVEREF(__pyx_r);
10870 __Pyx_RefNannyFinishContext();
10882 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
10883 struct __pyx_array_obj *__pyx_v_result = 0;
10884 struct __pyx_array_obj *__pyx_r = NULL;
10885 __Pyx_RefNannyDeclarations
10887 PyObject *__pyx_t_2 = NULL;
10888 PyObject *__pyx_t_3 = NULL;
10889 PyObject *__pyx_t_4 = NULL;
10890 PyObject *__pyx_t_5 = NULL;
10891 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
10900 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
10910 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 248, __pyx_L1_error)
10911 __Pyx_GOTREF(__pyx_t_2);
10912 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error)
10913 __Pyx_GOTREF(__pyx_t_3);
10914 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 248, __pyx_L1_error)
10915 __Pyx_GOTREF(__pyx_t_4);
10916 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 248, __pyx_L1_error)
10917 __Pyx_GOTREF(__pyx_t_5);
10918 __Pyx_INCREF(__pyx_v_shape);
10919 __Pyx_GIVEREF(__pyx_v_shape);
10920 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10921 __Pyx_GIVEREF(__pyx_t_2);
10922 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10923 __Pyx_GIVEREF(__pyx_t_3);
10924 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10925 __Pyx_GIVEREF(__pyx_t_4);
10926 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10930 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 248, __pyx_L1_error)
10931 __Pyx_GOTREF(__pyx_t_4);
10932 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10933 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
10954 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
10955 __Pyx_GOTREF(__pyx_t_4);
10956 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
10957 __Pyx_GOTREF(__pyx_t_5);
10958 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
10959 __Pyx_GOTREF(__pyx_t_3);
10960 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
10961 __Pyx_GOTREF(__pyx_t_2);
10962 __Pyx_INCREF(__pyx_v_shape);
10963 __Pyx_GIVEREF(__pyx_v_shape);
10964 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10965 __Pyx_GIVEREF(__pyx_t_4);
10966 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10967 __Pyx_GIVEREF(__pyx_t_5);
10968 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10969 __Pyx_GIVEREF(__pyx_t_3);
10970 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10982 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
10983 __Pyx_GOTREF(__pyx_t_3);
10984 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 251, __pyx_L1_error)
10993 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
10994 __Pyx_GOTREF(__pyx_t_5);
10995 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10996 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10997 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
11007 __pyx_v_result->data = __pyx_v_buf;
11018 __Pyx_XDECREF(((PyObject *)__pyx_r));
11019 __Pyx_INCREF(((PyObject *)__pyx_v_result));
11020 __pyx_r = __pyx_v_result;
11033 __Pyx_XDECREF(__pyx_t_2);
11034 __Pyx_XDECREF(__pyx_t_3);
11035 __Pyx_XDECREF(__pyx_t_4);
11036 __Pyx_XDECREF(__pyx_t_5);
11037 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
11040 __Pyx_XDECREF((PyObject *)__pyx_v_result);
11041 __Pyx_XGIVEREF((PyObject *)__pyx_r);
11042 __Pyx_RefNannyFinishContext();
11055 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11056 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11057 PyObject *__pyx_v_name = 0;
11059 __Pyx_RefNannyDeclarations
11060 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
11062 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
11063 PyObject* values[1] = {0};
11064 if (unlikely(__pyx_kwds)) {
11065 Py_ssize_t kw_args;
11066 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11067 switch (pos_args) {
11068 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11069 CYTHON_FALLTHROUGH;
11071 default:
goto __pyx_L5_argtuple_error;
11073 kw_args = PyDict_Size(__pyx_kwds);
11074 switch (pos_args) {
11076 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
11077 else goto __pyx_L5_argtuple_error;
11079 if (unlikely(kw_args > 0)) {
11080 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 280, __pyx_L3_error)
11082 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
11083 goto __pyx_L5_argtuple_error;
11085 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11087 __pyx_v_name = values[0];
11089 goto __pyx_L4_argument_unpacking_done;
11090 __pyx_L5_argtuple_error:;
11091 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 280, __pyx_L3_error)
11093 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11094 __Pyx_RefNannyFinishContext();
11096 __pyx_L4_argument_unpacking_done:;
11097 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
11100 __Pyx_RefNannyFinishContext();
11104 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
11106 __Pyx_RefNannyDeclarations
11107 __Pyx_RefNannySetupContext(
"__init__", 0);
11116 __Pyx_INCREF(__pyx_v_name);
11117 __Pyx_GIVEREF(__pyx_v_name);
11118 __Pyx_GOTREF(__pyx_v_self->name);
11119 __Pyx_DECREF(__pyx_v_self->name);
11120 __pyx_v_self->name = __pyx_v_name;
11132 __Pyx_RefNannyFinishContext();
11145 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
11146 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
11147 PyObject *__pyx_r = 0;
11148 __Pyx_RefNannyDeclarations
11149 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
11150 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
11153 __Pyx_RefNannyFinishContext();
11157 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
11158 PyObject *__pyx_r = NULL;
11159 __Pyx_RefNannyDeclarations
11160 __Pyx_RefNannySetupContext(
"__repr__", 0);
11169 __Pyx_XDECREF(__pyx_r);
11170 __Pyx_INCREF(__pyx_v_self->name);
11171 __pyx_r = __pyx_v_self->name;
11184 __Pyx_XGIVEREF(__pyx_r);
11185 __Pyx_RefNannyFinishContext();
11196 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
11197 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11198 PyObject *__pyx_r = 0;
11199 __Pyx_RefNannyDeclarations
11200 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
11201 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
11204 __Pyx_RefNannyFinishContext();
11208 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
11209 int __pyx_v_use_setstate;
11210 PyObject *__pyx_v_state = NULL;
11211 PyObject *__pyx_v__dict = NULL;
11212 PyObject *__pyx_r = NULL;
11213 __Pyx_RefNannyDeclarations
11214 PyObject *__pyx_t_1 = NULL;
11217 PyObject *__pyx_t_4 = NULL;
11218 PyObject *__pyx_t_5 = NULL;
11219 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
11228 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
11229 __Pyx_GOTREF(__pyx_t_1);
11230 __Pyx_INCREF(__pyx_v_self->name);
11231 __Pyx_GIVEREF(__pyx_v_self->name);
11232 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
11233 __pyx_v_state = ((PyObject*)__pyx_t_1);
11243 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11244 __Pyx_GOTREF(__pyx_t_1);
11245 __pyx_v__dict = __pyx_t_1;
11255 __pyx_t_2 = (__pyx_v__dict != Py_None);
11256 __pyx_t_3 = (__pyx_t_2 != 0);
11266 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
11267 __Pyx_GOTREF(__pyx_t_1);
11268 __Pyx_INCREF(__pyx_v__dict);
11269 __Pyx_GIVEREF(__pyx_v__dict);
11270 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
11271 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
11272 __Pyx_GOTREF(__pyx_t_4);
11273 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11274 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
11284 __pyx_v_use_setstate = 1;
11304 __pyx_t_3 = (__pyx_v_self->name != Py_None);
11305 __pyx_v_use_setstate = __pyx_t_3;
11316 __pyx_t_3 = (__pyx_v_use_setstate != 0);
11326 __Pyx_XDECREF(__pyx_r);
11327 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error)
11328 __Pyx_GOTREF(__pyx_t_4);
11329 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error)
11330 __Pyx_GOTREF(__pyx_t_1);
11331 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11332 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11333 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11334 __Pyx_INCREF(__pyx_int_184977713);
11335 __Pyx_GIVEREF(__pyx_int_184977713);
11336 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11337 __Pyx_INCREF(Py_None);
11338 __Pyx_GIVEREF(Py_None);
11339 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
11340 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 11, __pyx_L1_error)
11341 __Pyx_GOTREF(__pyx_t_5);
11342 __Pyx_GIVEREF(__pyx_t_4);
11343 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11344 __Pyx_GIVEREF(__pyx_t_1);
11345 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
11346 __Pyx_INCREF(__pyx_v_state);
11347 __Pyx_GIVEREF(__pyx_v_state);
11348 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
11351 __pyx_r = __pyx_t_5;
11372 __Pyx_XDECREF(__pyx_r);
11373 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
11374 __Pyx_GOTREF(__pyx_t_5);
11375 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
11376 __Pyx_GOTREF(__pyx_t_1);
11377 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11378 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11379 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11380 __Pyx_INCREF(__pyx_int_184977713);
11381 __Pyx_GIVEREF(__pyx_int_184977713);
11382 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11383 __Pyx_INCREF(__pyx_v_state);
11384 __Pyx_GIVEREF(__pyx_v_state);
11385 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
11386 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
11387 __Pyx_GOTREF(__pyx_t_4);
11388 __Pyx_GIVEREF(__pyx_t_5);
11389 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
11390 __Pyx_GIVEREF(__pyx_t_1);
11391 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
11394 __pyx_r = __pyx_t_4;
11407 __Pyx_XDECREF(__pyx_t_1);
11408 __Pyx_XDECREF(__pyx_t_4);
11409 __Pyx_XDECREF(__pyx_t_5);
11410 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11413 __Pyx_XDECREF(__pyx_v_state);
11414 __Pyx_XDECREF(__pyx_v__dict);
11415 __Pyx_XGIVEREF(__pyx_r);
11416 __Pyx_RefNannyFinishContext();
11428 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
11429 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11430 PyObject *__pyx_r = 0;
11431 __Pyx_RefNannyDeclarations
11432 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
11433 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11436 __Pyx_RefNannyFinishContext();
11440 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11441 PyObject *__pyx_r = NULL;
11442 __Pyx_RefNannyDeclarations
11443 PyObject *__pyx_t_1 = NULL;
11444 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
11451 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error)
11452 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
11453 __Pyx_GOTREF(__pyx_t_1);
11454 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11464 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11467 __Pyx_XDECREF(__pyx_t_1);
11468 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11471 __Pyx_XGIVEREF(__pyx_r);
11472 __Pyx_RefNannyFinishContext();
11484 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
11485 Py_intptr_t __pyx_v_aligned_p;
11486 size_t __pyx_v_offset;
11497 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
11506 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
11515 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
11525 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
11543 __pyx_r = ((
void *)__pyx_v_aligned_p);
11568 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11569 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11570 PyObject *__pyx_v_obj = 0;
11572 int __pyx_v_dtype_is_object;
11574 __Pyx_RefNannyDeclarations
11575 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
11577 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
11578 PyObject* values[3] = {0,0,0};
11579 if (unlikely(__pyx_kwds)) {
11580 Py_ssize_t kw_args;
11581 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11582 switch (pos_args) {
11583 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11584 CYTHON_FALLTHROUGH;
11585 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11586 CYTHON_FALLTHROUGH;
11587 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11588 CYTHON_FALLTHROUGH;
11590 default:
goto __pyx_L5_argtuple_error;
11592 kw_args = PyDict_Size(__pyx_kwds);
11593 switch (pos_args) {
11595 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
11596 else goto __pyx_L5_argtuple_error;
11597 CYTHON_FALLTHROUGH;
11599 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
11601 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 344, __pyx_L3_error)
11603 CYTHON_FALLTHROUGH;
11606 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
11607 if (value) { values[2] = value; kw_args--; }
11610 if (unlikely(kw_args > 0)) {
11611 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 344, __pyx_L3_error)
11614 switch (PyTuple_GET_SIZE(__pyx_args)) {
11615 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11616 CYTHON_FALLTHROUGH;
11617 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11618 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11620 default:
goto __pyx_L5_argtuple_error;
11623 __pyx_v_obj = values[0];
11624 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L3_error)
11626 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L3_error)
11628 __pyx_v_dtype_is_object = ((int)0);
11631 goto __pyx_L4_argument_unpacking_done;
11632 __pyx_L5_argtuple_error:;
11633 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 344, __pyx_L3_error)
11635 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11636 __Pyx_RefNannyFinishContext();
11638 __pyx_L4_argument_unpacking_done:;
11639 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
11642 __Pyx_RefNannyFinishContext();
11646 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
11648 __Pyx_RefNannyDeclarations
11653 __Pyx_RefNannySetupContext(
"__cinit__", 0);
11662 __Pyx_INCREF(__pyx_v_obj);
11663 __Pyx_GIVEREF(__pyx_v_obj);
11664 __Pyx_GOTREF(__pyx_v_self->obj);
11665 __Pyx_DECREF(__pyx_v_self->obj);
11666 __pyx_v_self->obj = __pyx_v_obj;
11675 __pyx_v_self->flags = __pyx_v_flags;
11684 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
11685 __pyx_t_3 = (__pyx_t_2 != 0);
11688 __pyx_t_1 = __pyx_t_3;
11689 goto __pyx_L4_bool_binop_done;
11691 __pyx_t_3 = (__pyx_v_obj != Py_None);
11692 __pyx_t_2 = (__pyx_t_3 != 0);
11693 __pyx_t_1 = __pyx_t_2;
11694 __pyx_L4_bool_binop_done:;
11704 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 348, __pyx_L1_error)
11713 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
11723 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
11732 Py_INCREF(Py_None);
11759 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
11769 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11778 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
11796 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11806 __pyx_v_self->lock = PyThread_allocate_lock();
11815 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11816 if (unlikely(__pyx_t_1)) {
11825 PyErr_NoMemory(); __PYX_ERR(1, 360, __pyx_L1_error)
11852 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11862 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
11865 __pyx_t_1 = __pyx_t_2;
11866 goto __pyx_L11_bool_binop_done;
11868 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
11869 __pyx_t_1 = __pyx_t_2;
11870 __pyx_L11_bool_binop_done:;
11871 __pyx_v_self->dtype_is_object = __pyx_t_1;
11891 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11902 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
11911 __pyx_v_self->typeinfo = NULL;
11925 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11928 __Pyx_RefNannyFinishContext();
11941 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
11942 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11943 __Pyx_RefNannyDeclarations
11944 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
11945 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11948 __Pyx_RefNannyFinishContext();
11951 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11953 __Pyx_RefNannyDeclarations
11959 PyThread_type_lock __pyx_t_6;
11960 PyThread_type_lock __pyx_t_7;
11961 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
11970 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11971 __pyx_t_2 = (__pyx_t_1 != 0);
11981 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11999 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
12009 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
12010 __pyx_t_4 = __pyx_t_3;
12011 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
12012 __pyx_v_i = __pyx_t_5;
12021 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
12031 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
12040 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
12050 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
12051 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
12060 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
12061 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
12079 goto __pyx_L6_break;
12099 PyThread_free_lock(__pyx_v_self->lock);
12121 __Pyx_RefNannyFinishContext();
12132 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
12133 Py_ssize_t __pyx_v_dim;
12134 char *__pyx_v_itemp;
12135 PyObject *__pyx_v_idx = NULL;
12137 __Pyx_RefNannyDeclarations
12138 Py_ssize_t __pyx_t_1;
12139 PyObject *__pyx_t_2 = NULL;
12140 Py_ssize_t __pyx_t_3;
12141 PyObject *(*__pyx_t_4)(PyObject *);
12142 PyObject *__pyx_t_5 = NULL;
12143 Py_ssize_t __pyx_t_6;
12145 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
12154 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
12164 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
12165 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
12168 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 392, __pyx_L1_error)
12169 __Pyx_GOTREF(__pyx_t_2);
12170 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 392, __pyx_L1_error)
12173 if (likely(!__pyx_t_4)) {
12174 if (likely(PyList_CheckExact(__pyx_t_2))) {
12175 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
12176 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12177 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error)
12179 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error)
12180 __Pyx_GOTREF(__pyx_t_5);
12183 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
12184 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12185 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error)
12187 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error)
12188 __Pyx_GOTREF(__pyx_t_5);
12192 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
12193 if (unlikely(!__pyx_t_5)) {
12194 PyObject* exc_type = PyErr_Occurred();
12196 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12197 else __PYX_ERR(1, 392, __pyx_L1_error)
12201 __Pyx_GOTREF(__pyx_t_5);
12203 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
12205 __pyx_v_dim = __pyx_t_1;
12206 __pyx_t_1 = (__pyx_t_1 + 1);
12215 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 393, __pyx_L1_error)
12216 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 393, __pyx_L1_error)
12217 __pyx_v_itemp = __pyx_t_7;
12227 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12236 __pyx_r = __pyx_v_itemp;
12249 __Pyx_XDECREF(__pyx_t_2);
12250 __Pyx_XDECREF(__pyx_t_5);
12251 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
12254 __Pyx_XDECREF(__pyx_v_idx);
12255 __Pyx_RefNannyFinishContext();
12268 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
12269 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
12270 PyObject *__pyx_r = 0;
12271 __Pyx_RefNannyDeclarations
12272 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
12273 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
12276 __Pyx_RefNannyFinishContext();
12280 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
12281 PyObject *__pyx_v_have_slices = NULL;
12282 PyObject *__pyx_v_indices = NULL;
12283 char *__pyx_v_itemp;
12284 PyObject *__pyx_r = NULL;
12285 __Pyx_RefNannyDeclarations
12288 PyObject *__pyx_t_3 = NULL;
12289 PyObject *__pyx_t_4 = NULL;
12290 PyObject *__pyx_t_5 = NULL;
12292 __Pyx_RefNannySetupContext(
"__getitem__", 0);
12301 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
12302 __pyx_t_2 = (__pyx_t_1 != 0);
12312 __Pyx_XDECREF(__pyx_r);
12313 __Pyx_INCREF(((PyObject *)__pyx_v_self));
12314 __pyx_r = ((PyObject *)__pyx_v_self);
12333 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 402, __pyx_L1_error)
12334 __Pyx_GOTREF(__pyx_t_3);
12335 if (likely(__pyx_t_3 != Py_None)) {
12336 PyObject* sequence = __pyx_t_3;
12337 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12338 if (unlikely(size != 2)) {
12339 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12340 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12341 __PYX_ERR(1, 402, __pyx_L1_error)
12343 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12344 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
12345 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
12346 __Pyx_INCREF(__pyx_t_4);
12347 __Pyx_INCREF(__pyx_t_5);
12349 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 402, __pyx_L1_error)
12350 __Pyx_GOTREF(__pyx_t_4);
12351 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 402, __pyx_L1_error)
12352 __Pyx_GOTREF(__pyx_t_5);
12354 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12356 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 402, __pyx_L1_error)
12358 __pyx_v_have_slices = __pyx_t_4;
12360 __pyx_v_indices = __pyx_t_5;
12370 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 405, __pyx_L1_error)
12380 __Pyx_XDECREF(__pyx_r);
12381 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error)
12382 __Pyx_GOTREF(__pyx_t_3);
12383 __pyx_r = __pyx_t_3;
12404 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 408, __pyx_L1_error)
12405 __pyx_v_itemp = __pyx_t_6;
12414 __Pyx_XDECREF(__pyx_r);
12415 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
12416 __Pyx_GOTREF(__pyx_t_3);
12417 __pyx_r = __pyx_t_3;
12432 __Pyx_XDECREF(__pyx_t_3);
12433 __Pyx_XDECREF(__pyx_t_4);
12434 __Pyx_XDECREF(__pyx_t_5);
12435 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12438 __Pyx_XDECREF(__pyx_v_have_slices);
12439 __Pyx_XDECREF(__pyx_v_indices);
12440 __Pyx_XGIVEREF(__pyx_r);
12441 __Pyx_RefNannyFinishContext();
12454 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
12455 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12457 __Pyx_RefNannyDeclarations
12458 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
12459 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
12462 __Pyx_RefNannyFinishContext();
12466 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12467 PyObject *__pyx_v_have_slices = NULL;
12468 PyObject *__pyx_v_obj = NULL;
12470 __Pyx_RefNannyDeclarations
12472 PyObject *__pyx_t_2 = NULL;
12473 PyObject *__pyx_t_3 = NULL;
12474 PyObject *__pyx_t_4 = NULL;
12475 __Pyx_RefNannySetupContext(
"__setitem__", 0);
12476 __Pyx_INCREF(__pyx_v_index);
12485 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
12486 if (unlikely(__pyx_t_1)) {
12495 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 413, __pyx_L1_error)
12496 __Pyx_GOTREF(__pyx_t_2);
12497 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12498 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12499 __PYX_ERR(1, 413, __pyx_L1_error)
12517 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
12518 __Pyx_GOTREF(__pyx_t_2);
12519 if (likely(__pyx_t_2 != Py_None)) {
12520 PyObject* sequence = __pyx_t_2;
12521 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12522 if (unlikely(size != 2)) {
12523 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12524 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12525 __PYX_ERR(1, 415, __pyx_L1_error)
12527 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12528 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
12529 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
12530 __Pyx_INCREF(__pyx_t_3);
12531 __Pyx_INCREF(__pyx_t_4);
12533 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 415, __pyx_L1_error)
12534 __Pyx_GOTREF(__pyx_t_3);
12535 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 415, __pyx_L1_error)
12536 __Pyx_GOTREF(__pyx_t_4);
12538 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12540 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 415, __pyx_L1_error)
12542 __pyx_v_have_slices = __pyx_t_3;
12544 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
12554 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 417, __pyx_L1_error)
12564 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
12565 __Pyx_GOTREF(__pyx_t_2);
12566 __pyx_v_obj = __pyx_t_2;
12576 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 419, __pyx_L1_error)
12586 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
12587 __Pyx_GOTREF(__pyx_t_2);
12588 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
12589 __Pyx_GOTREF(__pyx_t_4);
12590 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12591 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12611 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
12612 __Pyx_GOTREF(__pyx_t_4);
12613 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 422, __pyx_L1_error)
12614 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
12615 __Pyx_GOTREF(__pyx_t_2);
12616 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12617 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12639 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
12640 __Pyx_GOTREF(__pyx_t_2);
12641 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12657 __Pyx_XDECREF(__pyx_t_2);
12658 __Pyx_XDECREF(__pyx_t_3);
12659 __Pyx_XDECREF(__pyx_t_4);
12660 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12663 __Pyx_XDECREF(__pyx_v_have_slices);
12664 __Pyx_XDECREF(__pyx_v_obj);
12665 __Pyx_XDECREF(__pyx_v_index);
12666 __Pyx_RefNannyFinishContext();
12678 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
12679 PyObject *__pyx_r = NULL;
12680 __Pyx_RefNannyDeclarations
12683 PyObject *__pyx_t_3 = NULL;
12684 PyObject *__pyx_t_4 = NULL;
12685 PyObject *__pyx_t_5 = NULL;
12686 PyObject *__pyx_t_6 = NULL;
12687 PyObject *__pyx_t_7 = NULL;
12688 PyObject *__pyx_t_8 = NULL;
12690 __Pyx_RefNannySetupContext(
"is_slice", 0);
12691 __Pyx_INCREF(__pyx_v_obj);
12700 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
12701 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
12712 __Pyx_PyThreadState_declare
12713 __Pyx_PyThreadState_assign
12714 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
12715 __Pyx_XGOTREF(__pyx_t_3);
12716 __Pyx_XGOTREF(__pyx_t_4);
12717 __Pyx_XGOTREF(__pyx_t_5);
12727 __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 429, __pyx_L4_error)
12728 __Pyx_GOTREF(__pyx_t_6);
12737 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 430, __pyx_L4_error)
12738 __Pyx_GOTREF(__pyx_t_7);
12747 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 429, __pyx_L4_error)
12748 __Pyx_GOTREF(__pyx_t_8);
12749 __Pyx_INCREF(__pyx_v_obj);
12750 __Pyx_GIVEREF(__pyx_v_obj);
12751 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
12752 __Pyx_GIVEREF(__pyx_t_6);
12753 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
12754 __Pyx_GIVEREF(__pyx_t_7);
12755 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
12758 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 429, __pyx_L4_error)
12759 __Pyx_GOTREF(__pyx_t_7);
12760 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12761 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
12772 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12773 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12774 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12775 goto __pyx_L9_try_end;
12777 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12778 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12779 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12788 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
12790 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12791 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 431, __pyx_L6_except_error)
12792 __Pyx_GOTREF(__pyx_t_7);
12793 __Pyx_GOTREF(__pyx_t_8);
12794 __Pyx_GOTREF(__pyx_t_6);
12803 __Pyx_XDECREF(__pyx_r);
12804 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12805 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12806 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12807 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12808 goto __pyx_L7_except_return;
12810 goto __pyx_L6_except_error;
12811 __pyx_L6_except_error:;
12820 __Pyx_XGIVEREF(__pyx_t_3);
12821 __Pyx_XGIVEREF(__pyx_t_4);
12822 __Pyx_XGIVEREF(__pyx_t_5);
12823 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12824 goto __pyx_L1_error;
12825 __pyx_L7_except_return:;
12826 __Pyx_XGIVEREF(__pyx_t_3);
12827 __Pyx_XGIVEREF(__pyx_t_4);
12828 __Pyx_XGIVEREF(__pyx_t_5);
12829 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12850 __Pyx_XDECREF(__pyx_r);
12851 __Pyx_INCREF(__pyx_v_obj);
12852 __pyx_r = __pyx_v_obj;
12865 __Pyx_XDECREF(__pyx_t_6);
12866 __Pyx_XDECREF(__pyx_t_7);
12867 __Pyx_XDECREF(__pyx_t_8);
12868 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12871 __Pyx_XDECREF(__pyx_v_obj);
12872 __Pyx_XGIVEREF(__pyx_r);
12873 __Pyx_RefNannyFinishContext();
12885 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12886 __Pyx_memviewslice __pyx_v_dst_slice;
12887 __Pyx_memviewslice __pyx_v_src_slice;
12888 PyObject *__pyx_r = NULL;
12889 __Pyx_RefNannyDeclarations
12890 PyObject *__pyx_t_1 = NULL;
12894 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
12903 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 440, __pyx_L1_error)
12912 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 441, __pyx_L1_error)
12921 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
12922 __Pyx_GOTREF(__pyx_t_1);
12923 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 442, __pyx_L1_error)
12924 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12925 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
12926 __Pyx_GOTREF(__pyx_t_1);
12927 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 442, __pyx_L1_error)
12928 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12937 __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 440, __pyx_L1_error)
12948 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12951 __Pyx_XDECREF(__pyx_t_1);
12952 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12955 __Pyx_XGIVEREF(__pyx_r);
12956 __Pyx_RefNannyFinishContext();
12968 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
12969 int __pyx_v_array[0x80];
12971 void *__pyx_v_item;
12972 __Pyx_memviewslice *__pyx_v_dst_slice;
12973 __Pyx_memviewslice __pyx_v_tmp_slice;
12974 PyObject *__pyx_r = NULL;
12975 __Pyx_RefNannyDeclarations
12977 PyObject *__pyx_t_2 = NULL;
12980 char const *__pyx_t_5;
12981 PyObject *__pyx_t_6 = NULL;
12982 PyObject *__pyx_t_7 = NULL;
12983 PyObject *__pyx_t_8 = NULL;
12984 PyObject *__pyx_t_9 = NULL;
12985 PyObject *__pyx_t_10 = NULL;
12986 PyObject *__pyx_t_11 = NULL;
12987 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
12996 __pyx_v_tmp = NULL;
13005 __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
13014 __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
13024 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
13033 __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
13034 if (unlikely(__pyx_t_1)) {
13043 PyErr_NoMemory(); __PYX_ERR(1, 456, __pyx_L1_error)
13061 __pyx_v_item = __pyx_v_tmp;
13081 __pyx_v_item = ((
void *)__pyx_v_array);
13101 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
13111 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
13131 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 465, __pyx_L6_error)
13132 __Pyx_GOTREF(__pyx_t_2);
13133 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13144 __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
13154 __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 470, __pyx_L6_error)
13155 __Pyx_GOTREF(__pyx_t_2);
13156 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13174 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
13186 PyMem_Free(__pyx_v_tmp);
13191 __Pyx_PyThreadState_declare
13192 __Pyx_PyThreadState_assign
13193 __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
13194 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13195 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
13196 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
13197 __Pyx_XGOTREF(__pyx_t_6);
13198 __Pyx_XGOTREF(__pyx_t_7);
13199 __Pyx_XGOTREF(__pyx_t_8);
13200 __Pyx_XGOTREF(__pyx_t_9);
13201 __Pyx_XGOTREF(__pyx_t_10);
13202 __Pyx_XGOTREF(__pyx_t_11);
13203 __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
13205 PyMem_Free(__pyx_v_tmp);
13207 if (PY_MAJOR_VERSION >= 3) {
13208 __Pyx_XGIVEREF(__pyx_t_9);
13209 __Pyx_XGIVEREF(__pyx_t_10);
13210 __Pyx_XGIVEREF(__pyx_t_11);
13211 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
13213 __Pyx_XGIVEREF(__pyx_t_6);
13214 __Pyx_XGIVEREF(__pyx_t_7);
13215 __Pyx_XGIVEREF(__pyx_t_8);
13216 __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
13217 __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
13218 __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
13219 goto __pyx_L1_error;
13233 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13236 __Pyx_XDECREF(__pyx_t_2);
13237 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
13240 __Pyx_XGIVEREF(__pyx_r);
13241 __Pyx_RefNannyFinishContext();
13253 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
13254 char *__pyx_v_itemp;
13255 PyObject *__pyx_r = NULL;
13256 __Pyx_RefNannyDeclarations
13258 PyObject *__pyx_t_2 = NULL;
13259 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
13268 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 477, __pyx_L1_error)
13269 __pyx_v_itemp = __pyx_t_1;
13278 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 478, __pyx_L1_error)
13279 __Pyx_GOTREF(__pyx_t_2);
13280 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13291 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13294 __Pyx_XDECREF(__pyx_t_2);
13295 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
13298 __Pyx_XGIVEREF(__pyx_r);
13299 __Pyx_RefNannyFinishContext();
13311 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
13312 PyObject *__pyx_v_struct = NULL;
13313 PyObject *__pyx_v_bytesitem = 0;
13314 PyObject *__pyx_v_result = NULL;
13315 PyObject *__pyx_r = NULL;
13316 __Pyx_RefNannyDeclarations
13317 PyObject *__pyx_t_1 = NULL;
13318 PyObject *__pyx_t_2 = NULL;
13319 PyObject *__pyx_t_3 = NULL;
13320 PyObject *__pyx_t_4 = NULL;
13321 PyObject *__pyx_t_5 = NULL;
13322 PyObject *__pyx_t_6 = NULL;
13323 PyObject *__pyx_t_7 = NULL;
13325 PyObject *__pyx_t_9 = NULL;
13328 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
13337 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L1_error)
13338 __Pyx_GOTREF(__pyx_t_1);
13339 __pyx_v_struct = __pyx_t_1;
13349 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 486, __pyx_L1_error)
13350 __Pyx_GOTREF(__pyx_t_1);
13351 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
13362 __Pyx_PyThreadState_declare
13363 __Pyx_PyThreadState_assign
13364 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
13365 __Pyx_XGOTREF(__pyx_t_2);
13366 __Pyx_XGOTREF(__pyx_t_3);
13367 __Pyx_XGOTREF(__pyx_t_4);
13377 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 488, __pyx_L3_error)
13378 __Pyx_GOTREF(__pyx_t_5);
13379 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 488, __pyx_L3_error)
13380 __Pyx_GOTREF(__pyx_t_6);
13383 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
13384 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
13385 if (likely(__pyx_t_7)) {
13386 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
13387 __Pyx_INCREF(__pyx_t_7);
13388 __Pyx_INCREF(
function);
13389 __Pyx_DECREF_SET(__pyx_t_5,
function);
13393 #if CYTHON_FAST_PYCALL
13394 if (PyFunction_Check(__pyx_t_5)) {
13395 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13396 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
13397 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13398 __Pyx_GOTREF(__pyx_t_1);
13399 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13402 #if CYTHON_FAST_PYCCALL
13403 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
13404 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13405 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
13406 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13407 __Pyx_GOTREF(__pyx_t_1);
13408 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13412 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 488, __pyx_L3_error)
13413 __Pyx_GOTREF(__pyx_t_9);
13415 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
13417 __Pyx_GIVEREF(__pyx_t_6);
13418 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
13419 __Pyx_INCREF(__pyx_v_bytesitem);
13420 __Pyx_GIVEREF(__pyx_v_bytesitem);
13421 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
13423 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
13424 __Pyx_GOTREF(__pyx_t_1);
13425 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13427 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13428 __pyx_v_result = __pyx_t_1;
13448 __pyx_t_10 = strlen(__pyx_v_self->view.format);
13449 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
13459 __Pyx_XDECREF(__pyx_r);
13460 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L5_except_error)
13461 __Pyx_GOTREF(__pyx_t_1);
13462 __pyx_r = __pyx_t_1;
13464 goto __pyx_L6_except_return;
13482 __Pyx_XDECREF(__pyx_r);
13483 __Pyx_INCREF(__pyx_v_result);
13484 __pyx_r = __pyx_v_result;
13485 goto __pyx_L6_except_return;
13488 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13489 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13490 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13491 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13492 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13501 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
13502 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 489, __pyx_L5_except_error)
13503 __Pyx_GOTREF(__pyx_t_6);
13504 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
13505 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13506 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
13507 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
13509 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13510 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 489, __pyx_L5_except_error)
13511 __Pyx_GOTREF(__pyx_t_9);
13512 __Pyx_GOTREF(__pyx_t_5);
13513 __Pyx_GOTREF(__pyx_t_1);
13522 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 490, __pyx_L5_except_error)
13523 __Pyx_GOTREF(__pyx_t_6);
13524 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
13525 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13526 __PYX_ERR(1, 490, __pyx_L5_except_error)
13528 goto __pyx_L5_except_error;
13529 __pyx_L5_except_error:;
13538 __Pyx_XGIVEREF(__pyx_t_2);
13539 __Pyx_XGIVEREF(__pyx_t_3);
13540 __Pyx_XGIVEREF(__pyx_t_4);
13541 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13542 goto __pyx_L1_error;
13543 __pyx_L6_except_return:;
13544 __Pyx_XGIVEREF(__pyx_t_2);
13545 __Pyx_XGIVEREF(__pyx_t_3);
13546 __Pyx_XGIVEREF(__pyx_t_4);
13547 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13561 __Pyx_XDECREF(__pyx_t_1);
13562 __Pyx_XDECREF(__pyx_t_5);
13563 __Pyx_XDECREF(__pyx_t_6);
13564 __Pyx_XDECREF(__pyx_t_7);
13565 __Pyx_XDECREF(__pyx_t_9);
13566 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13569 __Pyx_XDECREF(__pyx_v_struct);
13570 __Pyx_XDECREF(__pyx_v_bytesitem);
13571 __Pyx_XDECREF(__pyx_v_result);
13572 __Pyx_XGIVEREF(__pyx_r);
13573 __Pyx_RefNannyFinishContext();
13585 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
13586 PyObject *__pyx_v_struct = NULL;
13588 PyObject *__pyx_v_bytesvalue = 0;
13589 Py_ssize_t __pyx_v_i;
13590 PyObject *__pyx_r = NULL;
13591 __Pyx_RefNannyDeclarations
13592 PyObject *__pyx_t_1 = NULL;
13595 PyObject *__pyx_t_4 = NULL;
13596 PyObject *__pyx_t_5 = NULL;
13597 PyObject *__pyx_t_6 = NULL;
13599 PyObject *__pyx_t_8 = NULL;
13600 Py_ssize_t __pyx_t_9;
13601 PyObject *__pyx_t_10 = NULL;
13606 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
13615 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error)
13616 __Pyx_GOTREF(__pyx_t_1);
13617 __pyx_v_struct = __pyx_t_1;
13627 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
13628 __pyx_t_3 = (__pyx_t_2 != 0);
13638 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 505, __pyx_L1_error)
13639 __Pyx_GOTREF(__pyx_t_1);
13640 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
13641 __Pyx_GOTREF(__pyx_t_4);
13642 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 505, __pyx_L1_error)
13643 __Pyx_GOTREF(__pyx_t_5);
13644 __Pyx_GIVEREF(__pyx_t_4);
13645 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
13647 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
13648 __Pyx_GOTREF(__pyx_t_4);
13649 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 505, __pyx_L1_error)
13650 __Pyx_GOTREF(__pyx_t_6);
13651 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13652 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13653 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
13654 __Pyx_GOTREF(__pyx_t_4);
13655 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13656 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13657 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 505, __pyx_L1_error)
13658 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13679 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 507, __pyx_L1_error)
13680 __Pyx_GOTREF(__pyx_t_6);
13681 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 507, __pyx_L1_error)
13682 __Pyx_GOTREF(__pyx_t_1);
13685 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
13686 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13687 if (likely(__pyx_t_5)) {
13688 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
13689 __Pyx_INCREF(__pyx_t_5);
13690 __Pyx_INCREF(
function);
13691 __Pyx_DECREF_SET(__pyx_t_6,
function);
13695 #if CYTHON_FAST_PYCALL
13696 if (PyFunction_Check(__pyx_t_6)) {
13697 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13698 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
13699 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13700 __Pyx_GOTREF(__pyx_t_4);
13701 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13704 #if CYTHON_FAST_PYCCALL
13705 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13706 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13707 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
13708 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13709 __Pyx_GOTREF(__pyx_t_4);
13710 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13714 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 507, __pyx_L1_error)
13715 __Pyx_GOTREF(__pyx_t_8);
13717 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
13719 __Pyx_GIVEREF(__pyx_t_1);
13720 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
13721 __Pyx_INCREF(__pyx_v_value);
13722 __Pyx_GIVEREF(__pyx_v_value);
13723 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
13725 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
13726 __Pyx_GOTREF(__pyx_t_4);
13727 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13729 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13730 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 507, __pyx_L1_error)
13731 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13744 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
13745 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
13746 __PYX_ERR(1, 509, __pyx_L1_error)
13748 __Pyx_INCREF(__pyx_v_bytesvalue);
13749 __pyx_t_10 = __pyx_v_bytesvalue;
13750 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
13751 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
13752 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
13753 __pyx_t_11 = __pyx_t_14;
13754 __pyx_v_c = (__pyx_t_11[0]);
13763 __pyx_v_i = __pyx_t_9;
13772 __pyx_t_9 = (__pyx_t_9 + 1);
13781 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
13783 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13794 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13797 __Pyx_XDECREF(__pyx_t_1);
13798 __Pyx_XDECREF(__pyx_t_4);
13799 __Pyx_XDECREF(__pyx_t_5);
13800 __Pyx_XDECREF(__pyx_t_6);
13801 __Pyx_XDECREF(__pyx_t_8);
13802 __Pyx_XDECREF(__pyx_t_10);
13803 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13806 __Pyx_XDECREF(__pyx_v_struct);
13807 __Pyx_XDECREF(__pyx_v_bytesvalue);
13808 __Pyx_XGIVEREF(__pyx_r);
13809 __Pyx_RefNannyFinishContext();
13822 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
13823 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
13825 __Pyx_RefNannyDeclarations
13826 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
13827 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
13830 __Pyx_RefNannyFinishContext();
13834 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
13836 __Pyx_RefNannyDeclarations
13839 PyObject *__pyx_t_3 = NULL;
13840 Py_ssize_t *__pyx_t_4;
13844 Py_ssize_t __pyx_t_8;
13845 if (__pyx_v_info == NULL) {
13846 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
13849 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
13850 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13851 __Pyx_GIVEREF(__pyx_v_info->obj);
13860 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13863 __pyx_t_1 = __pyx_t_2;
13864 goto __pyx_L4_bool_binop_done;
13866 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13867 __pyx_t_1 = __pyx_t_2;
13868 __pyx_L4_bool_binop_done:;
13869 if (unlikely(__pyx_t_1)) {
13878 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 515, __pyx_L1_error)
13879 __Pyx_GOTREF(__pyx_t_3);
13880 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13881 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13882 __PYX_ERR(1, 515, __pyx_L1_error)
13900 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13910 __pyx_t_4 = __pyx_v_self->view.shape;
13911 __pyx_v_info->shape = __pyx_t_4;
13931 __pyx_v_info->shape = NULL;
13942 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13952 __pyx_t_4 = __pyx_v_self->view.strides;
13953 __pyx_v_info->strides = __pyx_t_4;
13973 __pyx_v_info->strides = NULL;
13984 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13994 __pyx_t_4 = __pyx_v_self->view.suboffsets;
13995 __pyx_v_info->suboffsets = __pyx_t_4;
14015 __pyx_v_info->suboffsets = NULL;
14026 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
14036 __pyx_t_5 = __pyx_v_self->view.format;
14037 __pyx_v_info->format = __pyx_t_5;
14057 __pyx_v_info->format = NULL;
14068 __pyx_t_6 = __pyx_v_self->view.buf;
14069 __pyx_v_info->buf = __pyx_t_6;
14078 __pyx_t_7 = __pyx_v_self->view.ndim;
14079 __pyx_v_info->ndim = __pyx_t_7;
14088 __pyx_t_8 = __pyx_v_self->view.itemsize;
14089 __pyx_v_info->itemsize = __pyx_t_8;
14098 __pyx_t_8 = __pyx_v_self->view.len;
14099 __pyx_v_info->len = __pyx_t_8;
14108 __pyx_t_1 = __pyx_v_self->view.readonly;
14109 __pyx_v_info->readonly = __pyx_t_1;
14118 __Pyx_INCREF(((PyObject *)__pyx_v_self));
14119 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
14120 __Pyx_GOTREF(__pyx_v_info->obj);
14121 __Pyx_DECREF(__pyx_v_info->obj);
14122 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
14136 __Pyx_XDECREF(__pyx_t_3);
14137 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14139 if (__pyx_v_info->obj != NULL) {
14140 __Pyx_GOTREF(__pyx_v_info->obj);
14141 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
14145 if (__pyx_v_info->obj == Py_None) {
14146 __Pyx_GOTREF(__pyx_v_info->obj);
14147 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
14150 __Pyx_RefNannyFinishContext();
14163 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
14164 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
14165 PyObject *__pyx_r = 0;
14166 __Pyx_RefNannyDeclarations
14167 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14168 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14171 __Pyx_RefNannyFinishContext();
14175 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14176 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
14177 PyObject *__pyx_r = NULL;
14178 __Pyx_RefNannyDeclarations
14179 PyObject *__pyx_t_1 = NULL;
14181 __Pyx_RefNannySetupContext(
"__get__", 0);
14190 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
14191 __Pyx_GOTREF(__pyx_t_1);
14192 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 549, __pyx_L1_error)
14193 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
14203 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 550, __pyx_L1_error)
14212 __Pyx_XDECREF(__pyx_r);
14213 __Pyx_INCREF(((PyObject *)__pyx_v_result));
14214 __pyx_r = ((PyObject *)__pyx_v_result);
14227 __Pyx_XDECREF(__pyx_t_1);
14228 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14231 __Pyx_XDECREF((PyObject *)__pyx_v_result);
14232 __Pyx_XGIVEREF(__pyx_r);
14233 __Pyx_RefNannyFinishContext();
14246 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
14247 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
14248 PyObject *__pyx_r = 0;
14249 __Pyx_RefNannyDeclarations
14250 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14251 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14254 __Pyx_RefNannyFinishContext();
14258 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14259 PyObject *__pyx_r = NULL;
14260 __Pyx_RefNannyDeclarations
14261 __Pyx_RefNannySetupContext(
"__get__", 0);
14270 __Pyx_XDECREF(__pyx_r);
14271 __Pyx_INCREF(__pyx_v_self->obj);
14272 __pyx_r = __pyx_v_self->obj;
14285 __Pyx_XGIVEREF(__pyx_r);
14286 __Pyx_RefNannyFinishContext();
14299 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
14300 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
14301 PyObject *__pyx_r = 0;
14302 __Pyx_RefNannyDeclarations
14303 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14304 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14307 __Pyx_RefNannyFinishContext();
14311 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14312 Py_ssize_t __pyx_v_length;
14313 PyObject *__pyx_r = NULL;
14314 __Pyx_RefNannyDeclarations
14315 PyObject *__pyx_t_1 = NULL;
14316 Py_ssize_t *__pyx_t_2;
14317 Py_ssize_t *__pyx_t_3;
14318 Py_ssize_t *__pyx_t_4;
14319 PyObject *__pyx_t_5 = NULL;
14320 __Pyx_RefNannySetupContext(
"__get__", 0);
14329 __Pyx_XDECREF(__pyx_r);
14330 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
14331 __Pyx_GOTREF(__pyx_t_1);
14332 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14333 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
14334 __pyx_t_2 = __pyx_t_4;
14335 __pyx_v_length = (__pyx_t_2[0]);
14336 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 559, __pyx_L1_error)
14337 __Pyx_GOTREF(__pyx_t_5);
14338 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 559, __pyx_L1_error)
14339 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14341 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 559, __pyx_L1_error)
14342 __Pyx_GOTREF(__pyx_t_5);
14343 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14344 __pyx_r = __pyx_t_5;
14358 __Pyx_XDECREF(__pyx_t_1);
14359 __Pyx_XDECREF(__pyx_t_5);
14360 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14363 __Pyx_XGIVEREF(__pyx_r);
14364 __Pyx_RefNannyFinishContext();
14377 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
14378 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
14379 PyObject *__pyx_r = 0;
14380 __Pyx_RefNannyDeclarations
14381 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14382 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14385 __Pyx_RefNannyFinishContext();
14389 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14390 Py_ssize_t __pyx_v_stride;
14391 PyObject *__pyx_r = NULL;
14392 __Pyx_RefNannyDeclarations
14394 PyObject *__pyx_t_2 = NULL;
14395 Py_ssize_t *__pyx_t_3;
14396 Py_ssize_t *__pyx_t_4;
14397 Py_ssize_t *__pyx_t_5;
14398 PyObject *__pyx_t_6 = NULL;
14399 __Pyx_RefNannySetupContext(
"__get__", 0);
14408 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
14409 if (unlikely(__pyx_t_1)) {
14418 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error)
14419 __Pyx_GOTREF(__pyx_t_2);
14420 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
14421 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14422 __PYX_ERR(1, 565, __pyx_L1_error)
14440 __Pyx_XDECREF(__pyx_r);
14441 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 567, __pyx_L1_error)
14442 __Pyx_GOTREF(__pyx_t_2);
14443 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
14444 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14445 __pyx_t_3 = __pyx_t_5;
14446 __pyx_v_stride = (__pyx_t_3[0]);
14447 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 567, __pyx_L1_error)
14448 __Pyx_GOTREF(__pyx_t_6);
14449 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 567, __pyx_L1_error)
14450 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14452 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 567, __pyx_L1_error)
14453 __Pyx_GOTREF(__pyx_t_6);
14454 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14455 __pyx_r = __pyx_t_6;
14469 __Pyx_XDECREF(__pyx_t_2);
14470 __Pyx_XDECREF(__pyx_t_6);
14471 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14474 __Pyx_XGIVEREF(__pyx_r);
14475 __Pyx_RefNannyFinishContext();
14488 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
14489 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
14490 PyObject *__pyx_r = 0;
14491 __Pyx_RefNannyDeclarations
14492 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14493 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14496 __Pyx_RefNannyFinishContext();
14500 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14501 Py_ssize_t __pyx_v_suboffset;
14502 PyObject *__pyx_r = NULL;
14503 __Pyx_RefNannyDeclarations
14505 PyObject *__pyx_t_2 = NULL;
14506 PyObject *__pyx_t_3 = NULL;
14507 Py_ssize_t *__pyx_t_4;
14508 Py_ssize_t *__pyx_t_5;
14509 Py_ssize_t *__pyx_t_6;
14510 __Pyx_RefNannySetupContext(
"__get__", 0);
14519 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
14529 __Pyx_XDECREF(__pyx_r);
14530 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
14531 __Pyx_GOTREF(__pyx_t_2);
14532 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__26, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 572, __pyx_L1_error)
14533 __Pyx_GOTREF(__pyx_t_3);
14534 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14535 __pyx_r = __pyx_t_3;
14555 __Pyx_XDECREF(__pyx_r);
14556 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 574, __pyx_L1_error)
14557 __Pyx_GOTREF(__pyx_t_3);
14558 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
14559 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
14560 __pyx_t_4 = __pyx_t_6;
14561 __pyx_v_suboffset = (__pyx_t_4[0]);
14562 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
14563 __Pyx_GOTREF(__pyx_t_2);
14564 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 574, __pyx_L1_error)
14565 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14567 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
14568 __Pyx_GOTREF(__pyx_t_2);
14569 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14570 __pyx_r = __pyx_t_2;
14584 __Pyx_XDECREF(__pyx_t_2);
14585 __Pyx_XDECREF(__pyx_t_3);
14586 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14589 __Pyx_XGIVEREF(__pyx_r);
14590 __Pyx_RefNannyFinishContext();
14603 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
14604 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
14605 PyObject *__pyx_r = 0;
14606 __Pyx_RefNannyDeclarations
14607 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14608 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14611 __Pyx_RefNannyFinishContext();
14615 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14616 PyObject *__pyx_r = NULL;
14617 __Pyx_RefNannyDeclarations
14618 PyObject *__pyx_t_1 = NULL;
14619 __Pyx_RefNannySetupContext(
"__get__", 0);
14628 __Pyx_XDECREF(__pyx_r);
14629 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 578, __pyx_L1_error)
14630 __Pyx_GOTREF(__pyx_t_1);
14631 __pyx_r = __pyx_t_1;
14645 __Pyx_XDECREF(__pyx_t_1);
14646 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14649 __Pyx_XGIVEREF(__pyx_r);
14650 __Pyx_RefNannyFinishContext();
14663 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
14664 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
14665 PyObject *__pyx_r = 0;
14666 __Pyx_RefNannyDeclarations
14667 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14668 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14671 __Pyx_RefNannyFinishContext();
14675 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14676 PyObject *__pyx_r = NULL;
14677 __Pyx_RefNannyDeclarations
14678 PyObject *__pyx_t_1 = NULL;
14679 __Pyx_RefNannySetupContext(
"__get__", 0);
14688 __Pyx_XDECREF(__pyx_r);
14689 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 582, __pyx_L1_error)
14690 __Pyx_GOTREF(__pyx_t_1);
14691 __pyx_r = __pyx_t_1;
14705 __Pyx_XDECREF(__pyx_t_1);
14706 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14709 __Pyx_XGIVEREF(__pyx_r);
14710 __Pyx_RefNannyFinishContext();
14723 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
14724 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
14725 PyObject *__pyx_r = 0;
14726 __Pyx_RefNannyDeclarations
14727 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14728 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14731 __Pyx_RefNannyFinishContext();
14735 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14736 PyObject *__pyx_r = NULL;
14737 __Pyx_RefNannyDeclarations
14738 PyObject *__pyx_t_1 = NULL;
14739 PyObject *__pyx_t_2 = NULL;
14740 PyObject *__pyx_t_3 = NULL;
14741 __Pyx_RefNannySetupContext(
"__get__", 0);
14750 __Pyx_XDECREF(__pyx_r);
14751 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 586, __pyx_L1_error)
14752 __Pyx_GOTREF(__pyx_t_1);
14753 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 586, __pyx_L1_error)
14754 __Pyx_GOTREF(__pyx_t_2);
14755 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 586, __pyx_L1_error)
14756 __Pyx_GOTREF(__pyx_t_3);
14757 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14758 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14759 __pyx_r = __pyx_t_3;
14773 __Pyx_XDECREF(__pyx_t_1);
14774 __Pyx_XDECREF(__pyx_t_2);
14775 __Pyx_XDECREF(__pyx_t_3);
14776 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14779 __Pyx_XGIVEREF(__pyx_r);
14780 __Pyx_RefNannyFinishContext();
14793 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
14794 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14795 PyObject *__pyx_r = 0;
14796 __Pyx_RefNannyDeclarations
14797 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
14798 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14801 __Pyx_RefNannyFinishContext();
14805 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14806 PyObject *__pyx_v_result = NULL;
14807 PyObject *__pyx_v_length = NULL;
14808 PyObject *__pyx_r = NULL;
14809 __Pyx_RefNannyDeclarations
14812 Py_ssize_t *__pyx_t_3;
14813 Py_ssize_t *__pyx_t_4;
14814 Py_ssize_t *__pyx_t_5;
14815 PyObject *__pyx_t_6 = NULL;
14816 __Pyx_RefNannySetupContext(
"__get__", 0);
14825 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14826 __pyx_t_2 = (__pyx_t_1 != 0);
14836 __Pyx_INCREF(__pyx_int_1);
14837 __pyx_v_result = __pyx_int_1;
14846 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14847 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14848 __pyx_t_3 = __pyx_t_5;
14849 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 593, __pyx_L1_error)
14850 __Pyx_GOTREF(__pyx_t_6);
14851 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14861 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 594, __pyx_L1_error)
14862 __Pyx_GOTREF(__pyx_t_6);
14863 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14874 __Pyx_INCREF(__pyx_v_result);
14875 __Pyx_GIVEREF(__pyx_v_result);
14876 __Pyx_GOTREF(__pyx_v_self->_size);
14877 __Pyx_DECREF(__pyx_v_self->_size);
14878 __pyx_v_self->_size = __pyx_v_result;
14896 __Pyx_XDECREF(__pyx_r);
14897 __Pyx_INCREF(__pyx_v_self->_size);
14898 __pyx_r = __pyx_v_self->_size;
14911 __Pyx_XDECREF(__pyx_t_6);
14912 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14915 __Pyx_XDECREF(__pyx_v_result);
14916 __Pyx_XDECREF(__pyx_v_length);
14917 __Pyx_XGIVEREF(__pyx_r);
14918 __Pyx_RefNannyFinishContext();
14931 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
14932 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14933 Py_ssize_t __pyx_r;
14934 __Pyx_RefNannyDeclarations
14935 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
14936 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14939 __Pyx_RefNannyFinishContext();
14943 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14944 Py_ssize_t __pyx_r;
14945 __Pyx_RefNannyDeclarations
14947 __Pyx_RefNannySetupContext(
"__len__", 0);
14956 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14966 __pyx_r = (__pyx_v_self->view.shape[0]);
14998 __Pyx_RefNannyFinishContext();
15011 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
15012 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
15013 PyObject *__pyx_r = 0;
15014 __Pyx_RefNannyDeclarations
15015 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
15016 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15019 __Pyx_RefNannyFinishContext();
15023 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
15024 PyObject *__pyx_r = NULL;
15025 __Pyx_RefNannyDeclarations
15026 PyObject *__pyx_t_1 = NULL;
15027 PyObject *__pyx_t_2 = NULL;
15028 PyObject *__pyx_t_3 = NULL;
15029 __Pyx_RefNannySetupContext(
"__repr__", 0);
15038 __Pyx_XDECREF(__pyx_r);
15039 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 607, __pyx_L1_error)
15040 __Pyx_GOTREF(__pyx_t_1);
15041 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __pyx_L1_error)
15042 __Pyx_GOTREF(__pyx_t_2);
15043 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15044 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 607, __pyx_L1_error)
15045 __Pyx_GOTREF(__pyx_t_1);
15046 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15055 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
15056 __Pyx_GOTREF(__pyx_t_2);
15065 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 607, __pyx_L1_error)
15066 __Pyx_GOTREF(__pyx_t_3);
15067 __Pyx_GIVEREF(__pyx_t_1);
15068 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
15069 __Pyx_GIVEREF(__pyx_t_2);
15070 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
15073 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __pyx_L1_error)
15074 __Pyx_GOTREF(__pyx_t_2);
15075 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15076 __pyx_r = __pyx_t_2;
15090 __Pyx_XDECREF(__pyx_t_1);
15091 __Pyx_XDECREF(__pyx_t_2);
15092 __Pyx_XDECREF(__pyx_t_3);
15093 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15096 __Pyx_XGIVEREF(__pyx_r);
15097 __Pyx_RefNannyFinishContext();
15110 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
15111 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
15112 PyObject *__pyx_r = 0;
15113 __Pyx_RefNannyDeclarations
15114 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
15115 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15118 __Pyx_RefNannyFinishContext();
15122 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
15123 PyObject *__pyx_r = NULL;
15124 __Pyx_RefNannyDeclarations
15125 PyObject *__pyx_t_1 = NULL;
15126 PyObject *__pyx_t_2 = NULL;
15127 __Pyx_RefNannySetupContext(
"__str__", 0);
15136 __Pyx_XDECREF(__pyx_r);
15137 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
15138 __Pyx_GOTREF(__pyx_t_1);
15139 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 611, __pyx_L1_error)
15140 __Pyx_GOTREF(__pyx_t_2);
15141 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15142 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
15143 __Pyx_GOTREF(__pyx_t_1);
15144 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15145 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 611, __pyx_L1_error)
15146 __Pyx_GOTREF(__pyx_t_2);
15147 __Pyx_GIVEREF(__pyx_t_1);
15148 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
15150 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
15151 __Pyx_GOTREF(__pyx_t_1);
15152 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15153 __pyx_r = __pyx_t_1;
15167 __Pyx_XDECREF(__pyx_t_1);
15168 __Pyx_XDECREF(__pyx_t_2);
15169 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15172 __Pyx_XGIVEREF(__pyx_r);
15173 __Pyx_RefNannyFinishContext();
15186 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15187 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15188 PyObject *__pyx_r = 0;
15189 __Pyx_RefNannyDeclarations
15190 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
15191 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15194 __Pyx_RefNannyFinishContext();
15198 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
15199 __Pyx_memviewslice *__pyx_v_mslice;
15200 __Pyx_memviewslice __pyx_v_tmp;
15201 PyObject *__pyx_r = NULL;
15202 __Pyx_RefNannyDeclarations
15203 PyObject *__pyx_t_1 = NULL;
15204 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
15213 __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
15222 __Pyx_XDECREF(__pyx_r);
15223 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
15224 __Pyx_GOTREF(__pyx_t_1);
15225 __pyx_r = __pyx_t_1;
15239 __Pyx_XDECREF(__pyx_t_1);
15240 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15243 __Pyx_XGIVEREF(__pyx_r);
15244 __Pyx_RefNannyFinishContext();
15257 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15258 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15259 PyObject *__pyx_r = 0;
15260 __Pyx_RefNannyDeclarations
15261 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
15262 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15265 __Pyx_RefNannyFinishContext();
15269 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
15270 __Pyx_memviewslice *__pyx_v_mslice;
15271 __Pyx_memviewslice __pyx_v_tmp;
15272 PyObject *__pyx_r = NULL;
15273 __Pyx_RefNannyDeclarations
15274 PyObject *__pyx_t_1 = NULL;
15275 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
15284 __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
15293 __Pyx_XDECREF(__pyx_r);
15294 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 624, __pyx_L1_error)
15295 __Pyx_GOTREF(__pyx_t_1);
15296 __pyx_r = __pyx_t_1;
15310 __Pyx_XDECREF(__pyx_t_1);
15311 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15314 __Pyx_XGIVEREF(__pyx_r);
15315 __Pyx_RefNannyFinishContext();
15328 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15329 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15330 PyObject *__pyx_r = 0;
15331 __Pyx_RefNannyDeclarations
15332 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
15333 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15336 __Pyx_RefNannyFinishContext();
15340 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
15341 __Pyx_memviewslice __pyx_v_mslice;
15343 PyObject *__pyx_r = NULL;
15344 __Pyx_RefNannyDeclarations
15345 __Pyx_memviewslice __pyx_t_1;
15346 PyObject *__pyx_t_2 = NULL;
15347 __Pyx_RefNannySetupContext(
"copy", 0);
15356 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
15365 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
15374 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 631, __pyx_L1_error)
15375 __pyx_v_mslice = __pyx_t_1;
15384 __Pyx_XDECREF(__pyx_r);
15385 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 636, __pyx_L1_error)
15386 __Pyx_GOTREF(__pyx_t_2);
15387 __pyx_r = __pyx_t_2;
15401 __Pyx_XDECREF(__pyx_t_2);
15402 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15405 __Pyx_XGIVEREF(__pyx_r);
15406 __Pyx_RefNannyFinishContext();
15419 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15420 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15421 PyObject *__pyx_r = 0;
15422 __Pyx_RefNannyDeclarations
15423 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
15424 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15427 __Pyx_RefNannyFinishContext();
15431 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
15432 __Pyx_memviewslice __pyx_v_src;
15433 __Pyx_memviewslice __pyx_v_dst;
15435 PyObject *__pyx_r = NULL;
15436 __Pyx_RefNannyDeclarations
15437 __Pyx_memviewslice __pyx_t_1;
15438 PyObject *__pyx_t_2 = NULL;
15439 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
15448 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
15457 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
15466 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 643, __pyx_L1_error)
15467 __pyx_v_dst = __pyx_t_1;
15476 __Pyx_XDECREF(__pyx_r);
15477 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 648, __pyx_L1_error)
15478 __Pyx_GOTREF(__pyx_t_2);
15479 __pyx_r = __pyx_t_2;
15493 __Pyx_XDECREF(__pyx_t_2);
15494 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
15497 __Pyx_XGIVEREF(__pyx_r);
15498 __Pyx_RefNannyFinishContext();
15509 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
15510 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15511 PyObject *__pyx_r = 0;
15512 __Pyx_RefNannyDeclarations
15513 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
15514 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
15517 __Pyx_RefNannyFinishContext();
15521 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
15522 PyObject *__pyx_r = NULL;
15523 __Pyx_RefNannyDeclarations
15524 PyObject *__pyx_t_1 = NULL;
15525 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
15533 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
15534 __Pyx_GOTREF(__pyx_t_1);
15535 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15536 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15537 __PYX_ERR(1, 2, __pyx_L1_error)
15547 __Pyx_XDECREF(__pyx_t_1);
15548 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15550 __Pyx_XGIVEREF(__pyx_r);
15551 __Pyx_RefNannyFinishContext();
15563 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
15564 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15565 PyObject *__pyx_r = 0;
15566 __Pyx_RefNannyDeclarations
15567 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
15568 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15571 __Pyx_RefNannyFinishContext();
15575 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15576 PyObject *__pyx_r = NULL;
15577 __Pyx_RefNannyDeclarations
15578 PyObject *__pyx_t_1 = NULL;
15579 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
15586 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
15587 __Pyx_GOTREF(__pyx_t_1);
15588 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15589 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15590 __PYX_ERR(1, 4, __pyx_L1_error)
15601 __Pyx_XDECREF(__pyx_t_1);
15602 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15604 __Pyx_XGIVEREF(__pyx_r);
15605 __Pyx_RefNannyFinishContext();
15617 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
15618 struct __pyx_memoryview_obj *__pyx_v_result = 0;
15619 PyObject *__pyx_r = NULL;
15620 __Pyx_RefNannyDeclarations
15621 PyObject *__pyx_t_1 = NULL;
15622 PyObject *__pyx_t_2 = NULL;
15623 PyObject *__pyx_t_3 = NULL;
15624 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
15633 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 653, __pyx_L1_error)
15634 __Pyx_GOTREF(__pyx_t_1);
15635 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
15636 __Pyx_GOTREF(__pyx_t_2);
15637 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 653, __pyx_L1_error)
15638 __Pyx_GOTREF(__pyx_t_3);
15639 __Pyx_INCREF(__pyx_v_o);
15640 __Pyx_GIVEREF(__pyx_v_o);
15641 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
15642 __Pyx_GIVEREF(__pyx_t_1);
15643 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
15644 __Pyx_GIVEREF(__pyx_t_2);
15645 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
15648 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
15649 __Pyx_GOTREF(__pyx_t_2);
15650 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15651 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
15661 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
15670 __Pyx_XDECREF(__pyx_r);
15671 __Pyx_INCREF(((PyObject *)__pyx_v_result));
15672 __pyx_r = ((PyObject *)__pyx_v_result);
15685 __Pyx_XDECREF(__pyx_t_1);
15686 __Pyx_XDECREF(__pyx_t_2);
15687 __Pyx_XDECREF(__pyx_t_3);
15688 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
15691 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15692 __Pyx_XGIVEREF(__pyx_r);
15693 __Pyx_RefNannyFinishContext();
15705 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
15707 __Pyx_RefNannyDeclarations
15709 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
15718 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
15719 __pyx_r = __pyx_t_1;
15732 __Pyx_RefNannyFinishContext();
15744 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
15745 PyObject *__pyx_v_tup = NULL;
15746 PyObject *__pyx_v_result = NULL;
15747 int __pyx_v_have_slices;
15748 int __pyx_v_seen_ellipsis;
15749 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
15750 PyObject *__pyx_v_item = NULL;
15751 Py_ssize_t __pyx_v_nslices;
15752 PyObject *__pyx_r = NULL;
15753 __Pyx_RefNannyDeclarations
15756 PyObject *__pyx_t_3 = NULL;
15757 PyObject *__pyx_t_4 = NULL;
15758 Py_ssize_t __pyx_t_5;
15759 PyObject *(*__pyx_t_6)(PyObject *);
15760 PyObject *__pyx_t_7 = NULL;
15761 Py_ssize_t __pyx_t_8;
15764 PyObject *__pyx_t_11 = NULL;
15765 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
15774 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15775 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15785 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 667, __pyx_L1_error)
15786 __Pyx_GOTREF(__pyx_t_3);
15787 __Pyx_INCREF(__pyx_v_index);
15788 __Pyx_GIVEREF(__pyx_v_index);
15789 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15790 __pyx_v_tup = __pyx_t_3;
15811 __Pyx_INCREF(__pyx_v_index);
15812 __pyx_v_tup = __pyx_v_index;
15823 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 671, __pyx_L1_error)
15824 __Pyx_GOTREF(__pyx_t_3);
15825 __pyx_v_result = ((PyObject*)__pyx_t_3);
15835 __pyx_v_have_slices = 0;
15844 __pyx_v_seen_ellipsis = 0;
15853 __Pyx_INCREF(__pyx_int_0);
15854 __pyx_t_3 = __pyx_int_0;
15855 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15856 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15859 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 674, __pyx_L1_error)
15860 __Pyx_GOTREF(__pyx_t_4);
15861 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 674, __pyx_L1_error)
15864 if (likely(!__pyx_t_6)) {
15865 if (likely(PyList_CheckExact(__pyx_t_4))) {
15866 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
15867 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15868 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 674, __pyx_L1_error)
15870 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
15871 __Pyx_GOTREF(__pyx_t_7);
15874 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
15875 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15876 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 674, __pyx_L1_error)
15878 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
15879 __Pyx_GOTREF(__pyx_t_7);
15883 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15884 if (unlikely(!__pyx_t_7)) {
15885 PyObject* exc_type = PyErr_Occurred();
15887 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15888 else __PYX_ERR(1, 674, __pyx_L1_error)
15892 __Pyx_GOTREF(__pyx_t_7);
15894 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15896 __Pyx_INCREF(__pyx_t_3);
15897 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15898 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
15899 __Pyx_GOTREF(__pyx_t_7);
15900 __Pyx_DECREF(__pyx_t_3);
15901 __pyx_t_3 = __pyx_t_7;
15911 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15912 __pyx_t_1 = (__pyx_t_2 != 0);
15922 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15932 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 677, __pyx_L1_error)
15933 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 677, __pyx_L1_error)
15934 __Pyx_GOTREF(__pyx_t_7);
15935 { Py_ssize_t __pyx_temp;
15936 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15937 __Pyx_INCREF(__pyx_slice__29);
15938 __Pyx_GIVEREF(__pyx_slice__29);
15939 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__29);
15942 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 677, __pyx_L1_error)
15943 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15952 __pyx_v_seen_ellipsis = 1;
15972 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__30);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 680, __pyx_L1_error)
15983 __pyx_v_have_slices = 1;
16003 __pyx_t_2 = PySlice_Check(__pyx_v_item);
16004 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
16007 __pyx_t_1 = __pyx_t_10;
16008 goto __pyx_L9_bool_binop_done;
16010 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
16011 __pyx_t_1 = __pyx_t_10;
16012 __pyx_L9_bool_binop_done:;
16013 if (unlikely(__pyx_t_1)) {
16022 __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
16023 __Pyx_GOTREF(__pyx_t_7);
16024 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 684, __pyx_L1_error)
16025 __Pyx_GOTREF(__pyx_t_11);
16026 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16027 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
16028 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
16029 __PYX_ERR(1, 684, __pyx_L1_error)
16047 __pyx_t_10 = (__pyx_v_have_slices != 0);
16050 __pyx_t_1 = __pyx_t_10;
16051 goto __pyx_L11_bool_binop_done;
16053 __pyx_t_10 = PySlice_Check(__pyx_v_item);
16054 __pyx_t_2 = (__pyx_t_10 != 0);
16055 __pyx_t_1 = __pyx_t_2;
16056 __pyx_L11_bool_binop_done:;
16057 __pyx_v_have_slices = __pyx_t_1;
16066 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
16078 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16079 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16088 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 689, __pyx_L1_error)
16089 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
16098 __pyx_t_1 = (__pyx_v_nslices != 0);
16108 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 691, __pyx_L1_error)
16109 __Pyx_GOTREF(__pyx_t_3);
16110 { Py_ssize_t __pyx_temp;
16111 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
16112 __Pyx_INCREF(__pyx_slice__31);
16113 __Pyx_GIVEREF(__pyx_slice__31);
16114 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__31);
16117 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 691, __pyx_L1_error)
16118 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16136 __Pyx_XDECREF(__pyx_r);
16137 if (!__pyx_v_have_slices) {
16139 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
16140 __Pyx_GOTREF(__pyx_t_4);
16141 __pyx_t_3 = __pyx_t_4;
16143 goto __pyx_L14_bool_binop_done;
16145 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
16146 __Pyx_GOTREF(__pyx_t_4);
16147 __pyx_t_3 = __pyx_t_4;
16149 __pyx_L14_bool_binop_done:;
16150 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
16151 __Pyx_GOTREF(__pyx_t_4);
16152 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 693, __pyx_L1_error)
16153 __Pyx_GOTREF(__pyx_t_11);
16154 __Pyx_GIVEREF(__pyx_t_3);
16155 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
16156 __Pyx_GIVEREF(__pyx_t_4);
16157 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
16160 __pyx_r = ((PyObject*)__pyx_t_11);
16174 __Pyx_XDECREF(__pyx_t_3);
16175 __Pyx_XDECREF(__pyx_t_4);
16176 __Pyx_XDECREF(__pyx_t_7);
16177 __Pyx_XDECREF(__pyx_t_11);
16178 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
16181 __Pyx_XDECREF(__pyx_v_tup);
16182 __Pyx_XDECREF(__pyx_v_result);
16183 __Pyx_XDECREF(__pyx_v_idx);
16184 __Pyx_XDECREF(__pyx_v_item);
16185 __Pyx_XGIVEREF(__pyx_r);
16186 __Pyx_RefNannyFinishContext();
16198 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
16199 Py_ssize_t __pyx_v_suboffset;
16200 PyObject *__pyx_r = NULL;
16201 __Pyx_RefNannyDeclarations
16202 Py_ssize_t *__pyx_t_1;
16203 Py_ssize_t *__pyx_t_2;
16204 Py_ssize_t *__pyx_t_3;
16206 PyObject *__pyx_t_5 = NULL;
16207 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
16216 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
16217 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
16218 __pyx_t_1 = __pyx_t_3;
16219 __pyx_v_suboffset = (__pyx_t_1[0]);
16228 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
16229 if (unlikely(__pyx_t_4)) {
16238 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 698, __pyx_L1_error)
16239 __Pyx_GOTREF(__pyx_t_5);
16240 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
16241 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16242 __PYX_ERR(1, 698, __pyx_L1_error)
16263 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16266 __Pyx_XDECREF(__pyx_t_5);
16267 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
16270 __Pyx_XGIVEREF(__pyx_r);
16271 __Pyx_RefNannyFinishContext();
16283 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
16284 int __pyx_v_new_ndim;
16285 int __pyx_v_suboffset_dim;
16287 __Pyx_memviewslice __pyx_v_src;
16288 __Pyx_memviewslice __pyx_v_dst;
16289 __Pyx_memviewslice *__pyx_v_p_src;
16290 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
16291 __Pyx_memviewslice *__pyx_v_p_dst;
16292 int *__pyx_v_p_suboffset_dim;
16293 Py_ssize_t __pyx_v_start;
16294 Py_ssize_t __pyx_v_stop;
16295 Py_ssize_t __pyx_v_step;
16296 int __pyx_v_have_start;
16297 int __pyx_v_have_stop;
16298 int __pyx_v_have_step;
16299 PyObject *__pyx_v_index = NULL;
16300 struct __pyx_memoryview_obj *__pyx_r = NULL;
16301 __Pyx_RefNannyDeclarations
16304 PyObject *__pyx_t_3 = NULL;
16305 struct __pyx_memoryview_obj *__pyx_t_4;
16308 Py_ssize_t __pyx_t_7;
16309 PyObject *(*__pyx_t_8)(PyObject *);
16310 PyObject *__pyx_t_9 = NULL;
16311 Py_ssize_t __pyx_t_10;
16313 Py_ssize_t __pyx_t_12;
16314 __Pyx_RefNannySetupContext(
"memview_slice", 0);
16323 __pyx_v_new_ndim = 0;
16324 __pyx_v_suboffset_dim = -1;
16333 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
16342 #ifndef CYTHON_WITHOUT_ASSERTIONS
16343 if (unlikely(!Py_OptimizeFlag)) {
16344 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
16345 PyErr_SetNone(PyExc_AssertionError);
16346 __PYX_ERR(1, 717, __pyx_L1_error)
16358 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16359 __pyx_t_2 = (__pyx_t_1 != 0);
16369 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 720, __pyx_L1_error)
16370 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
16371 __Pyx_INCREF(__pyx_t_3);
16372 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
16382 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
16402 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
16411 __pyx_v_p_src = (&__pyx_v_src);
16422 __pyx_t_4 = __pyx_v_p_src->memview;
16423 __pyx_v_dst.memview = __pyx_t_4;
16432 __pyx_t_5 = __pyx_v_p_src->data;
16433 __pyx_v_dst.data = __pyx_t_5;
16442 __pyx_v_p_dst = (&__pyx_v_dst);
16451 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
16461 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
16462 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
16465 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 741, __pyx_L1_error)
16466 __Pyx_GOTREF(__pyx_t_3);
16467 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 741, __pyx_L1_error)
16470 if (likely(!__pyx_t_8)) {
16471 if (likely(PyList_CheckExact(__pyx_t_3))) {
16472 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
16473 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16474 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 741, __pyx_L1_error)
16476 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 741, __pyx_L1_error)
16477 __Pyx_GOTREF(__pyx_t_9);
16480 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
16481 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16482 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 741, __pyx_L1_error)
16484 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 741, __pyx_L1_error)
16485 __Pyx_GOTREF(__pyx_t_9);
16489 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
16490 if (unlikely(!__pyx_t_9)) {
16491 PyObject* exc_type = PyErr_Occurred();
16493 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16494 else __PYX_ERR(1, 741, __pyx_L1_error)
16498 __Pyx_GOTREF(__pyx_t_9);
16500 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
16502 __pyx_v_dim = __pyx_t_6;
16503 __pyx_t_6 = (__pyx_t_6 + 1);
16512 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
16522 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error)
16531 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 743, __pyx_L1_error)
16550 __pyx_t_2 = (__pyx_v_index == Py_None);
16551 __pyx_t_1 = (__pyx_t_2 != 0);
16561 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
16570 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
16579 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1
L;
16588 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16608 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 755, __pyx_L1_error)
16609 __Pyx_GOTREF(__pyx_t_9);
16610 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 755, __pyx_L1_error)
16612 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16614 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 755, __pyx_L1_error)
16615 __pyx_t_10 = __pyx_t_12;
16616 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16617 goto __pyx_L7_bool_binop_done;
16620 __pyx_L7_bool_binop_done:;
16621 __pyx_v_start = __pyx_t_10;
16630 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 756, __pyx_L1_error)
16631 __Pyx_GOTREF(__pyx_t_9);
16632 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 756, __pyx_L1_error)
16634 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16636 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 756, __pyx_L1_error)
16637 __pyx_t_10 = __pyx_t_12;
16638 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16639 goto __pyx_L9_bool_binop_done;
16642 __pyx_L9_bool_binop_done:;
16643 __pyx_v_stop = __pyx_t_10;
16652 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 757, __pyx_L1_error)
16653 __Pyx_GOTREF(__pyx_t_9);
16654 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 757, __pyx_L1_error)
16656 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16658 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error)
16659 __pyx_t_10 = __pyx_t_12;
16660 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16661 goto __pyx_L11_bool_binop_done;
16664 __pyx_L11_bool_binop_done:;
16665 __pyx_v_step = __pyx_t_10;
16674 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 759, __pyx_L1_error)
16675 __Pyx_GOTREF(__pyx_t_9);
16676 __pyx_t_1 = (__pyx_t_9 != Py_None);
16677 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16678 __pyx_v_have_start = __pyx_t_1;
16687 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
16688 __Pyx_GOTREF(__pyx_t_9);
16689 __pyx_t_1 = (__pyx_t_9 != Py_None);
16690 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16691 __pyx_v_have_stop = __pyx_t_1;
16700 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
16701 __Pyx_GOTREF(__pyx_t_9);
16702 __pyx_t_1 = (__pyx_t_9 != Py_None);
16703 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16704 __pyx_v_have_step = __pyx_t_1;
16713 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 763, __pyx_L1_error)
16722 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16734 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16743 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16744 __pyx_t_2 = (__pyx_t_1 != 0);
16754 __Pyx_XDECREF(((PyObject *)__pyx_r));
16763 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 773, __pyx_L1_error) }
16772 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 774, __pyx_L1_error) }
16781 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 772, __pyx_L1_error)
16782 __Pyx_GOTREF(__pyx_t_3);
16783 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 772, __pyx_L1_error)
16784 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
16805 __Pyx_XDECREF(((PyObject *)__pyx_r));
16814 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
16815 __Pyx_GOTREF(__pyx_t_3);
16824 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
16825 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
16840 __Pyx_XDECREF(__pyx_t_3);
16841 __Pyx_XDECREF(__pyx_t_9);
16842 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16845 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16846 __Pyx_XDECREF(__pyx_v_index);
16847 __Pyx_XGIVEREF((PyObject *)__pyx_r);
16848 __Pyx_RefNannyFinishContext();
16860 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
16861 Py_ssize_t __pyx_v_new_shape;
16862 int __pyx_v_negative_step;
16875 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16885 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16895 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16913 __pyx_t_1 = (0 <= __pyx_v_start);
16915 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16917 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16927 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 827, __pyx_L1_error)
16956 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16959 __pyx_t_2 = __pyx_t_1;
16960 goto __pyx_L6_bool_binop_done;
16962 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16963 __pyx_t_2 = __pyx_t_1;
16964 __pyx_L6_bool_binop_done:;
16965 __pyx_v_negative_step = __pyx_t_2;
16974 __pyx_t_1 = (__pyx_v_have_step != 0);
16977 __pyx_t_2 = __pyx_t_1;
16978 goto __pyx_L9_bool_binop_done;
16980 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16981 __pyx_t_2 = __pyx_t_1;
16982 __pyx_L9_bool_binop_done:;
16992 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 833, __pyx_L1_error)
17010 __pyx_t_2 = (__pyx_v_have_start != 0);
17020 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
17030 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
17039 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
17077 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
17087 __pyx_t_2 = (__pyx_v_negative_step != 0);
17097 __pyx_v_start = (__pyx_v_shape - 1);
17117 __pyx_v_start = __pyx_v_shape;
17149 __pyx_t_2 = (__pyx_v_negative_step != 0);
17159 __pyx_v_start = (__pyx_v_shape - 1);
17192 __pyx_t_2 = (__pyx_v_have_stop != 0);
17202 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
17212 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
17221 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
17259 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
17269 __pyx_v_stop = __pyx_v_shape;
17299 __pyx_t_2 = (__pyx_v_negative_step != 0);
17309 __pyx_v_stop = -1
L;
17329 __pyx_v_stop = __pyx_v_shape;
17342 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
17370 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
17379 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
17389 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
17407 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
17417 __pyx_v_new_shape = 0;
17435 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
17444 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
17453 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
17464 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
17474 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
17494 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
17495 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
17506 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17516 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
17526 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
17536 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
17564 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 894, __pyx_L1_error)
17586 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
17621 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17623 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17625 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17641 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
17642 Py_ssize_t __pyx_v_shape;
17643 Py_ssize_t __pyx_v_stride;
17644 Py_ssize_t __pyx_v_suboffset;
17645 Py_ssize_t __pyx_v_itemsize;
17646 char *__pyx_v_resultp;
17648 __Pyx_RefNannyDeclarations
17649 Py_ssize_t __pyx_t_1;
17651 PyObject *__pyx_t_3 = NULL;
17652 PyObject *__pyx_t_4 = NULL;
17653 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
17662 __pyx_v_suboffset = -1
L;
17671 __pyx_t_1 = __pyx_v_view->itemsize;
17672 __pyx_v_itemsize = __pyx_t_1;
17681 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
17691 if (unlikely(__pyx_v_itemsize == 0)) {
17692 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
17693 __PYX_ERR(1, 912, __pyx_L1_error)
17695 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
17696 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
17697 __PYX_ERR(1, 912, __pyx_L1_error)
17699 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
17708 __pyx_v_stride = __pyx_v_itemsize;
17728 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
17737 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
17746 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
17756 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
17776 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17786 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17795 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17796 if (unlikely(__pyx_t_2)) {
17805 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error)
17806 __Pyx_GOTREF(__pyx_t_3);
17807 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 923, __pyx_L1_error)
17808 __Pyx_GOTREF(__pyx_t_4);
17809 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17810 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error)
17811 __Pyx_GOTREF(__pyx_t_3);
17812 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17813 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17814 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17815 __PYX_ERR(1, 923, __pyx_L1_error)
17842 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17843 if (unlikely(__pyx_t_2)) {
17852 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __pyx_L1_error)
17853 __Pyx_GOTREF(__pyx_t_3);
17854 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 926, __pyx_L1_error)
17855 __Pyx_GOTREF(__pyx_t_4);
17856 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17857 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __pyx_L1_error)
17858 __Pyx_GOTREF(__pyx_t_3);
17859 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17860 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17861 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17862 __PYX_ERR(1, 926, __pyx_L1_error)
17880 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17889 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17899 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17917 __pyx_r = __pyx_v_resultp;
17930 __Pyx_XDECREF(__pyx_t_3);
17931 __Pyx_XDECREF(__pyx_t_4);
17932 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17935 __Pyx_RefNannyFinishContext();
17947 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17949 Py_ssize_t *__pyx_v_shape;
17950 Py_ssize_t *__pyx_v_strides;
17955 Py_ssize_t *__pyx_t_2;
17958 Py_ssize_t __pyx_t_5;
17959 Py_ssize_t __pyx_t_6;
17971 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17972 __pyx_v_ndim = __pyx_t_1;
17981 __pyx_t_2 = __pyx_v_memslice->shape;
17982 __pyx_v_shape = __pyx_t_2;
17991 __pyx_t_2 = __pyx_v_memslice->strides;
17992 __pyx_v_strides = __pyx_t_2;
18001 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
18002 __pyx_t_4 = __pyx_t_3;
18003 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
18004 __pyx_v_i = __pyx_t_1;
18013 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
18022 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
18023 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
18024 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
18025 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
18034 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
18035 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
18036 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
18037 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
18046 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
18049 __pyx_t_7 = __pyx_t_8;
18050 goto __pyx_L6_bool_binop_done;
18052 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
18053 __pyx_t_7 = __pyx_t_8;
18054 __pyx_L6_bool_binop_done:;
18064 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 952, __pyx_L1_error)
18098 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18100 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18102 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18119 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
18120 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
18121 __Pyx_RefNannyDeclarations
18122 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
18123 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18126 __Pyx_RefNannyFinishContext();
18129 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18130 __Pyx_RefNannyDeclarations
18131 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
18140 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
18151 __Pyx_RefNannyFinishContext();
18162 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
18163 PyObject *__pyx_r = NULL;
18164 __Pyx_RefNannyDeclarations
18166 PyObject *__pyx_t_2 = NULL;
18167 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
18176 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
18186 __Pyx_XDECREF(__pyx_r);
18187 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 976, __pyx_L1_error)
18188 __Pyx_GOTREF(__pyx_t_2);
18189 __pyx_r = __pyx_t_2;
18210 __Pyx_XDECREF(__pyx_r);
18211 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 978, __pyx_L1_error)
18212 __Pyx_GOTREF(__pyx_t_2);
18213 __pyx_r = __pyx_t_2;
18228 __Pyx_XDECREF(__pyx_t_2);
18229 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18232 __Pyx_XGIVEREF(__pyx_r);
18233 __Pyx_RefNannyFinishContext();
18245 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
18246 PyObject *__pyx_r = NULL;
18247 __Pyx_RefNannyDeclarations
18250 PyObject *__pyx_t_3 = NULL;
18251 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
18260 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
18270 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 982, __pyx_L1_error)
18290 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 984, __pyx_L1_error)
18291 __Pyx_GOTREF(__pyx_t_3);
18292 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18305 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18308 __Pyx_XDECREF(__pyx_t_3);
18309 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18312 __Pyx_XGIVEREF(__pyx_r);
18313 __Pyx_RefNannyFinishContext();
18326 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
18327 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
18328 PyObject *__pyx_r = 0;
18329 __Pyx_RefNannyDeclarations
18330 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
18331 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18334 __Pyx_RefNannyFinishContext();
18338 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18339 PyObject *__pyx_r = NULL;
18340 __Pyx_RefNannyDeclarations
18341 __Pyx_RefNannySetupContext(
"__get__", 0);
18350 __Pyx_XDECREF(__pyx_r);
18351 __Pyx_INCREF(__pyx_v_self->from_object);
18352 __pyx_r = __pyx_v_self->from_object;
18365 __Pyx_XGIVEREF(__pyx_r);
18366 __Pyx_RefNannyFinishContext();
18377 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
18378 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18379 PyObject *__pyx_r = 0;
18380 __Pyx_RefNannyDeclarations
18381 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
18382 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18385 __Pyx_RefNannyFinishContext();
18389 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18390 PyObject *__pyx_r = NULL;
18391 __Pyx_RefNannyDeclarations
18392 PyObject *__pyx_t_1 = NULL;
18393 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
18401 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
18402 __Pyx_GOTREF(__pyx_t_1);
18403 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18404 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18405 __PYX_ERR(1, 2, __pyx_L1_error)
18415 __Pyx_XDECREF(__pyx_t_1);
18416 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18418 __Pyx_XGIVEREF(__pyx_r);
18419 __Pyx_RefNannyFinishContext();
18431 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
18432 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18433 PyObject *__pyx_r = 0;
18434 __Pyx_RefNannyDeclarations
18435 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
18436 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18439 __Pyx_RefNannyFinishContext();
18443 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18444 PyObject *__pyx_r = NULL;
18445 __Pyx_RefNannyDeclarations
18446 PyObject *__pyx_t_1 = NULL;
18447 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
18454 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18455 __Pyx_GOTREF(__pyx_t_1);
18456 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18457 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18458 __PYX_ERR(1, 4, __pyx_L1_error)
18469 __Pyx_XDECREF(__pyx_t_1);
18470 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18472 __Pyx_XGIVEREF(__pyx_r);
18473 __Pyx_RefNannyFinishContext();
18485 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
18486 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
18487 Py_ssize_t __pyx_v_suboffset;
18488 PyObject *__pyx_v_length = NULL;
18489 PyObject *__pyx_r = NULL;
18490 __Pyx_RefNannyDeclarations
18492 PyObject *__pyx_t_2 = NULL;
18493 PyObject *__pyx_t_3 = NULL;
18494 __Pyx_TypeInfo *__pyx_t_4;
18495 Py_buffer __pyx_t_5;
18496 Py_ssize_t *__pyx_t_6;
18497 Py_ssize_t *__pyx_t_7;
18498 Py_ssize_t *__pyx_t_8;
18499 Py_ssize_t __pyx_t_9;
18500 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
18509 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
18519 __Pyx_XDECREF(__pyx_r);
18520 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18539 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1008, __pyx_L1_error)
18540 __Pyx_GOTREF(__pyx_t_2);
18541 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1008, __pyx_L1_error)
18542 __Pyx_GOTREF(__pyx_t_3);
18543 __Pyx_INCREF(Py_None);
18544 __Pyx_GIVEREF(Py_None);
18545 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
18546 __Pyx_INCREF(__pyx_int_0);
18547 __Pyx_GIVEREF(__pyx_int_0);
18548 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
18549 __Pyx_GIVEREF(__pyx_t_2);
18550 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18552 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1008, __pyx_L1_error)
18553 __Pyx_GOTREF(__pyx_t_2);
18554 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18555 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
18565 __pyx_v_result->from_slice = __pyx_v_memviewslice;
18574 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
18583 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
18584 __Pyx_GOTREF(__pyx_t_2);
18585 __Pyx_GIVEREF(__pyx_t_2);
18586 __Pyx_GOTREF(__pyx_v_result->from_object);
18587 __Pyx_DECREF(__pyx_v_result->from_object);
18588 __pyx_v_result->from_object = __pyx_t_2;
18598 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
18599 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
18608 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
18609 __pyx_v_result->__pyx_base.view = __pyx_t_5;
18618 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
18627 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
18636 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
18645 Py_INCREF(Py_None);
18654 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
18664 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
18684 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
18695 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
18704 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
18713 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
18722 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
18723 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18724 __pyx_t_6 = __pyx_t_8;
18725 __pyx_v_suboffset = (__pyx_t_6[0]);
18734 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
18744 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
18753 goto __pyx_L6_break;
18773 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18774 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18783 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18784 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18785 __pyx_t_6 = __pyx_t_8;
18786 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1038, __pyx_L1_error)
18787 __Pyx_GOTREF(__pyx_t_2);
18788 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18798 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1039, __pyx_L1_error)
18799 __Pyx_GOTREF(__pyx_t_2);
18800 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1039, __pyx_L1_error)
18801 __Pyx_GOTREF(__pyx_t_3);
18802 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18803 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1039, __pyx_L1_error)
18804 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18805 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18815 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18824 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18833 __Pyx_XDECREF(__pyx_r);
18834 __Pyx_INCREF(((PyObject *)__pyx_v_result));
18835 __pyx_r = ((PyObject *)__pyx_v_result);
18848 __Pyx_XDECREF(__pyx_t_2);
18849 __Pyx_XDECREF(__pyx_t_3);
18850 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18853 __Pyx_XDECREF((PyObject *)__pyx_v_result);
18854 __Pyx_XDECREF(__pyx_v_length);
18855 __Pyx_XGIVEREF(__pyx_r);
18856 __Pyx_RefNannyFinishContext();
18868 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18869 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18870 __Pyx_memviewslice *__pyx_r;
18871 __Pyx_RefNannyDeclarations
18874 PyObject *__pyx_t_3 = NULL;
18875 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
18884 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18885 __pyx_t_2 = (__pyx_t_1 != 0);
18895 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1051, __pyx_L1_error)
18896 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18897 __Pyx_INCREF(__pyx_t_3);
18898 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18908 __pyx_r = (&__pyx_v_obj->from_slice);
18928 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18937 __pyx_r = __pyx_v_mslice;
18951 __Pyx_XDECREF(__pyx_t_3);
18952 __Pyx_WriteUnraisable(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18955 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18956 __Pyx_RefNannyFinishContext();
18968 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18970 Py_ssize_t *__pyx_v_shape;
18971 Py_ssize_t *__pyx_v_strides;
18972 Py_ssize_t *__pyx_v_suboffsets;
18973 __Pyx_RefNannyDeclarations
18974 Py_ssize_t *__pyx_t_1;
18978 Py_ssize_t __pyx_t_5;
18979 __Pyx_RefNannySetupContext(
"slice_copy", 0);
18988 __pyx_t_1 = __pyx_v_memview->view.shape;
18989 __pyx_v_shape = __pyx_t_1;
18998 __pyx_t_1 = __pyx_v_memview->view.strides;
18999 __pyx_v_strides = __pyx_t_1;
19008 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
19009 __pyx_v_suboffsets = __pyx_t_1;
19018 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
19027 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
19036 __pyx_t_2 = __pyx_v_memview->view.ndim;
19037 __pyx_t_3 = __pyx_t_2;
19038 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19039 __pyx_v_dim = __pyx_t_4;
19048 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
19057 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
19066 if ((__pyx_v_suboffsets != 0)) {
19067 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
19071 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
19083 __Pyx_RefNannyFinishContext();
19094 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
19095 __Pyx_memviewslice __pyx_v_memviewslice;
19096 PyObject *__pyx_r = NULL;
19097 __Pyx_RefNannyDeclarations
19098 PyObject *__pyx_t_1 = NULL;
19099 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
19108 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
19117 __Pyx_XDECREF(__pyx_r);
19118 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1079, __pyx_L1_error)
19119 __Pyx_GOTREF(__pyx_t_1);
19120 __pyx_r = __pyx_t_1;
19134 __Pyx_XDECREF(__pyx_t_1);
19135 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
19138 __Pyx_XGIVEREF(__pyx_r);
19139 __Pyx_RefNannyFinishContext();
19151 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
19152 PyObject *(*__pyx_v_to_object_func)(
char *);
19153 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
19154 PyObject *__pyx_r = NULL;
19155 __Pyx_RefNannyDeclarations
19158 PyObject *(*__pyx_t_3)(
char *);
19159 int (*__pyx_t_4)(
char *, PyObject *);
19160 PyObject *__pyx_t_5 = NULL;
19161 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
19170 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19171 __pyx_t_2 = (__pyx_t_1 != 0);
19181 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
19182 __pyx_v_to_object_func = __pyx_t_3;
19191 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
19192 __pyx_v_to_dtype_func = __pyx_t_4;
19212 __pyx_v_to_object_func = NULL;
19221 __pyx_v_to_dtype_func = NULL;
19232 __Pyx_XDECREF(__pyx_r);
19241 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1096, __pyx_L1_error)
19242 __Pyx_GOTREF(__pyx_t_5);
19243 __pyx_r = __pyx_t_5;
19257 __Pyx_XDECREF(__pyx_t_5);
19258 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19261 __Pyx_XGIVEREF(__pyx_r);
19262 __Pyx_RefNannyFinishContext();
19274 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
19275 Py_ssize_t __pyx_r;
19285 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
19295 __pyx_r = (-__pyx_v_arg);
19315 __pyx_r = __pyx_v_arg;
19340 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
19342 Py_ssize_t __pyx_v_c_stride;
19343 Py_ssize_t __pyx_v_f_stride;
19357 __pyx_v_c_stride = 0;
19366 __pyx_v_f_stride = 0;
19375 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19376 __pyx_v_i = __pyx_t_1;
19385 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19395 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19404 goto __pyx_L4_break;
19424 __pyx_t_1 = __pyx_v_ndim;
19425 __pyx_t_3 = __pyx_t_1;
19426 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19427 __pyx_v_i = __pyx_t_4;
19436 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19446 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19455 goto __pyx_L7_break;
19475 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
19530 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
19531 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19532 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
19533 Py_ssize_t __pyx_v_dst_extent;
19534 Py_ssize_t __pyx_v_src_stride;
19535 Py_ssize_t __pyx_v_dst_stride;
19539 Py_ssize_t __pyx_t_4;
19540 Py_ssize_t __pyx_t_5;
19541 Py_ssize_t __pyx_t_6;
19550 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
19559 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
19568 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
19577 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
19586 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19596 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
19599 __pyx_t_1 = __pyx_t_2;
19600 goto __pyx_L5_bool_binop_done;
19602 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
19605 __pyx_t_1 = __pyx_t_2;
19606 goto __pyx_L5_bool_binop_done;
19616 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
19618 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
19620 __pyx_t_3 = (__pyx_t_2 != 0);
19621 __pyx_t_1 = __pyx_t_3;
19622 __pyx_L5_bool_binop_done:;
19640 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
19660 __pyx_t_4 = __pyx_v_dst_extent;
19661 __pyx_t_5 = __pyx_t_4;
19662 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19663 __pyx_v_i = __pyx_t_6;
19672 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
19681 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19690 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19713 __pyx_t_4 = __pyx_v_dst_extent;
19714 __pyx_t_5 = __pyx_t_4;
19715 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19716 __pyx_v_i = __pyx_t_6;
19725 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
19734 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19743 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19767 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
19776 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
19797 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
19799 Py_ssize_t __pyx_v_size;
19800 Py_ssize_t __pyx_r;
19801 Py_ssize_t __pyx_t_1;
19813 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19814 __pyx_v_size = __pyx_t_1;
19823 __pyx_t_2 = __pyx_v_ndim;
19824 __pyx_t_3 = __pyx_t_2;
19825 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19826 __pyx_v_i = __pyx_t_4;
19835 __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
19845 __pyx_r = __pyx_v_size;
19869 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
19871 Py_ssize_t __pyx_r;
19884 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
19894 __pyx_t_2 = __pyx_v_ndim;
19895 __pyx_t_3 = __pyx_t_2;
19896 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19897 __pyx_v_idx = __pyx_t_4;
19906 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19915 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19936 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19937 __pyx_v_idx = __pyx_t_2;
19946 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19955 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19967 __pyx_r = __pyx_v_stride;
19991 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
19993 void *__pyx_v_result;
19994 size_t __pyx_v_itemsize;
19995 size_t __pyx_v_size;
19997 Py_ssize_t __pyx_t_1;
20000 struct __pyx_memoryview_obj *__pyx_t_4;
20011 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
20012 __pyx_v_itemsize = __pyx_t_1;
20021 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
20030 __pyx_v_result = malloc(__pyx_v_size);
20039 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
20049 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1220, __pyx_L1_error)
20067 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
20076 __pyx_t_4 = __pyx_v_src->memview;
20077 __pyx_v_tmpslice->memview = __pyx_t_4;
20086 __pyx_t_3 = __pyx_v_ndim;
20087 __pyx_t_5 = __pyx_t_3;
20088 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20089 __pyx_v_i = __pyx_t_6;
20098 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
20107 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1
L;
20117 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
20126 __pyx_t_3 = __pyx_v_ndim;
20127 __pyx_t_5 = __pyx_t_3;
20128 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20129 __pyx_v_i = __pyx_t_6;
20138 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
20148 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
20167 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
20177 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
20197 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
20208 __pyx_r = __pyx_v_result;
20223 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20225 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
20227 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20243 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
20245 __Pyx_RefNannyDeclarations
20246 PyObject *__pyx_t_1 = NULL;
20247 PyObject *__pyx_t_2 = NULL;
20248 PyObject *__pyx_t_3 = NULL;
20249 PyObject *__pyx_t_4 = NULL;
20251 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20253 __Pyx_RefNannySetupContext(
"_err_extents", 0);
20262 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1250, __pyx_L1_error)
20263 __Pyx_GOTREF(__pyx_t_1);
20264 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1250, __pyx_L1_error)
20265 __Pyx_GOTREF(__pyx_t_2);
20266 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1250, __pyx_L1_error)
20267 __Pyx_GOTREF(__pyx_t_3);
20268 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1250, __pyx_L1_error)
20269 __Pyx_GOTREF(__pyx_t_4);
20270 __Pyx_GIVEREF(__pyx_t_1);
20271 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
20272 __Pyx_GIVEREF(__pyx_t_2);
20273 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
20274 __Pyx_GIVEREF(__pyx_t_3);
20275 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
20287 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1249, __pyx_L1_error)
20288 __Pyx_GOTREF(__pyx_t_3);
20289 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20290 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
20291 __Pyx_GOTREF(__pyx_t_4);
20292 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20293 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20294 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20295 __PYX_ERR(1, 1249, __pyx_L1_error)
20307 __Pyx_XDECREF(__pyx_t_1);
20308 __Pyx_XDECREF(__pyx_t_2);
20309 __Pyx_XDECREF(__pyx_t_3);
20310 __Pyx_XDECREF(__pyx_t_4);
20311 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20313 __Pyx_RefNannyFinishContext();
20315 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20328 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
20330 __Pyx_RefNannyDeclarations
20331 PyObject *__pyx_t_1 = NULL;
20332 PyObject *__pyx_t_2 = NULL;
20333 PyObject *__pyx_t_3 = NULL;
20334 PyObject *__pyx_t_4 = NULL;
20335 PyObject *__pyx_t_5 = NULL;
20337 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20339 __Pyx_RefNannySetupContext(
"_err_dim", 0);
20340 __Pyx_INCREF(__pyx_v_error);
20349 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
20350 __Pyx_GOTREF(__pyx_t_2);
20351 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
20352 __Pyx_GOTREF(__pyx_t_3);
20353 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
20354 __Pyx_GOTREF(__pyx_t_4);
20355 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20356 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20357 __Pyx_INCREF(__pyx_v_error);
20358 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
20359 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
20360 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
20361 if (likely(__pyx_t_2)) {
20362 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
20363 __Pyx_INCREF(__pyx_t_2);
20364 __Pyx_INCREF(
function);
20365 __Pyx_DECREF_SET(__pyx_t_3,
function);
20369 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
20370 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20371 __Pyx_GOTREF(__pyx_t_1);
20373 #if CYTHON_FAST_PYCALL
20374 if (PyFunction_Check(__pyx_t_3)) {
20375 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
20376 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
20377 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20378 __Pyx_GOTREF(__pyx_t_1);
20379 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20382 #if CYTHON_FAST_PYCCALL
20383 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
20384 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
20385 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
20386 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20387 __Pyx_GOTREF(__pyx_t_1);
20388 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20392 __pyx_t_5 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1254, __pyx_L1_error)
20393 __Pyx_GOTREF(__pyx_t_5);
20394 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
20395 __Pyx_GIVEREF(__pyx_t_4);
20396 PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
20398 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
20399 __Pyx_GOTREF(__pyx_t_1);
20400 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20403 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20404 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20405 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20406 __PYX_ERR(1, 1254, __pyx_L1_error)
20418 __Pyx_XDECREF(__pyx_t_1);
20419 __Pyx_XDECREF(__pyx_t_2);
20420 __Pyx_XDECREF(__pyx_t_3);
20421 __Pyx_XDECREF(__pyx_t_4);
20422 __Pyx_XDECREF(__pyx_t_5);
20423 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
20425 __Pyx_XDECREF(__pyx_v_error);
20426 __Pyx_RefNannyFinishContext();
20428 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20441 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
20443 __Pyx_RefNannyDeclarations
20445 PyObject *__pyx_t_2 = NULL;
20446 PyObject *__pyx_t_3 = NULL;
20447 PyObject *__pyx_t_4 = NULL;
20448 PyObject *__pyx_t_5 = NULL;
20449 PyObject *__pyx_t_6 = NULL;
20451 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20453 __Pyx_RefNannySetupContext(
"_err", 0);
20454 __Pyx_INCREF(__pyx_v_error);
20463 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
20464 if (unlikely(__pyx_t_1)) {
20473 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1259, __pyx_L1_error)
20474 __Pyx_GOTREF(__pyx_t_3);
20475 __Pyx_INCREF(__pyx_v_error);
20476 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
20477 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
20478 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20479 if (likely(__pyx_t_5)) {
20480 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
20481 __Pyx_INCREF(__pyx_t_5);
20482 __Pyx_INCREF(
function);
20483 __Pyx_DECREF_SET(__pyx_t_4,
function);
20487 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
20488 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20489 __Pyx_GOTREF(__pyx_t_2);
20491 #if CYTHON_FAST_PYCALL
20492 if (PyFunction_Check(__pyx_t_4)) {
20493 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
20494 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
20495 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20496 __Pyx_GOTREF(__pyx_t_2);
20497 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20500 #if CYTHON_FAST_PYCCALL
20501 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
20502 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
20503 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
20504 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20505 __Pyx_GOTREF(__pyx_t_2);
20506 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20510 __pyx_t_6 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1259, __pyx_L1_error)
20511 __Pyx_GOTREF(__pyx_t_6);
20512 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
20513 __Pyx_GIVEREF(__pyx_t_3);
20514 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
20516 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
20517 __Pyx_GOTREF(__pyx_t_2);
20518 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20521 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20522 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
20523 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20524 __PYX_ERR(1, 1259, __pyx_L1_error)
20543 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
20544 __PYX_ERR(1, 1261, __pyx_L1_error)
20557 __Pyx_XDECREF(__pyx_t_2);
20558 __Pyx_XDECREF(__pyx_t_3);
20559 __Pyx_XDECREF(__pyx_t_4);
20560 __Pyx_XDECREF(__pyx_t_5);
20561 __Pyx_XDECREF(__pyx_t_6);
20562 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
20564 __Pyx_XDECREF(__pyx_v_error);
20565 __Pyx_RefNannyFinishContext();
20567 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20580 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
20581 void *__pyx_v_tmpdata;
20582 size_t __pyx_v_itemsize;
20584 char __pyx_v_order;
20585 int __pyx_v_broadcasting;
20586 int __pyx_v_direct_copy;
20587 __Pyx_memviewslice __pyx_v_tmp;
20590 Py_ssize_t __pyx_t_1;
20606 __pyx_v_tmpdata = NULL;
20615 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
20616 __pyx_v_itemsize = __pyx_t_1;
20625 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
20634 __pyx_v_broadcasting = 0;
20643 __pyx_v_direct_copy = 0;
20652 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
20662 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
20681 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
20691 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
20710 __pyx_t_3 = __pyx_v_dst_ndim;
20711 __pyx_t_4 = __pyx_v_src_ndim;
20712 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
20713 __pyx_t_5 = __pyx_t_3;
20715 __pyx_t_5 = __pyx_t_4;
20717 __pyx_v_ndim = __pyx_t_5;
20726 __pyx_t_5 = __pyx_v_ndim;
20727 __pyx_t_3 = __pyx_t_5;
20728 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20729 __pyx_v_i = __pyx_t_4;
20738 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
20748 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
20758 __pyx_v_broadcasting = 1;
20767 (__pyx_v_src.strides[__pyx_v_i]) = 0;
20787 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1293, __pyx_L1_error)
20807 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20817 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1296, __pyx_L1_error)
20836 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20846 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20856 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20874 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1303, __pyx_L1_error)
20875 __pyx_v_tmpdata = __pyx_t_7;
20884 __pyx_v_src = __pyx_v_tmp;
20902 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20912 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
20922 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
20941 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
20951 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
20970 __pyx_t_2 = (__pyx_v_direct_copy != 0);
20980 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20989 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20998 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21007 free(__pyx_v_tmpdata);
21044 __pyx_t_2 = (__pyx_v_order ==
'F');
21046 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
21048 __pyx_t_8 = (__pyx_t_2 != 0);
21058 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1325, __pyx_L1_error)
21067 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1326, __pyx_L1_error)
21085 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21094 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
21103 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21112 free(__pyx_v_tmpdata);
21136 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21138 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
21140 __Pyx_PyGILState_Release(__pyx_gilstate_save);
21156 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
21158 int __pyx_v_offset;
21170 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
21179 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
21180 __pyx_v_i = __pyx_t_1;
21189 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
21198 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
21207 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
21217 __pyx_t_1 = __pyx_v_offset;
21218 __pyx_t_2 = __pyx_t_1;
21219 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21220 __pyx_v_i = __pyx_t_3;
21229 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
21238 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
21247 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1
L;
21269 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
21279 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
21289 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
21319 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
21320 __Pyx_RefNannyDeclarations
21322 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21324 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
21333 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
21344 __Pyx_RefNannyFinishContext();
21346 __Pyx_PyGILState_Release(__pyx_gilstate_save);
21358 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
21359 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21360 __Pyx_RefNannyDeclarations
21361 Py_ssize_t __pyx_t_1;
21362 Py_ssize_t __pyx_t_2;
21363 Py_ssize_t __pyx_t_3;
21365 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
21374 __pyx_t_1 = (__pyx_v_shape[0]);
21375 __pyx_t_2 = __pyx_t_1;
21376 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21377 __pyx_v_i = __pyx_t_3;
21386 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
21396 __pyx_t_4 = (__pyx_v_inc != 0);
21406 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
21426 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
21456 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
21467 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
21479 __Pyx_RefNannyFinishContext();
21490 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
21499 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21508 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
21517 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21538 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
21539 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21540 Py_ssize_t __pyx_v_stride;
21541 Py_ssize_t __pyx_v_extent;
21543 Py_ssize_t __pyx_t_2;
21544 Py_ssize_t __pyx_t_3;
21545 Py_ssize_t __pyx_t_4;
21554 __pyx_v_stride = (__pyx_v_strides[0]);
21563 __pyx_v_extent = (__pyx_v_shape[0]);
21572 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
21582 __pyx_t_2 = __pyx_v_extent;
21583 __pyx_t_3 = __pyx_t_2;
21584 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21585 __pyx_v_i = __pyx_t_4;
21594 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
21603 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21624 __pyx_t_2 = __pyx_v_extent;
21625 __pyx_t_3 = __pyx_t_2;
21626 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21627 __pyx_v_i = __pyx_t_4;
21636 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
21645 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21668 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
21669 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
21670 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21671 PyObject *__pyx_v___pyx_type = 0;
21672 long __pyx_v___pyx_checksum;
21673 PyObject *__pyx_v___pyx_state = 0;
21674 PyObject *__pyx_r = 0;
21675 __Pyx_RefNannyDeclarations
21676 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
21678 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
21679 PyObject* values[3] = {0,0,0};
21680 if (unlikely(__pyx_kwds)) {
21681 Py_ssize_t kw_args;
21682 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21683 switch (pos_args) {
21684 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21685 CYTHON_FALLTHROUGH;
21686 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21687 CYTHON_FALLTHROUGH;
21688 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21689 CYTHON_FALLTHROUGH;
21691 default:
goto __pyx_L5_argtuple_error;
21693 kw_args = PyDict_Size(__pyx_kwds);
21694 switch (pos_args) {
21696 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
21697 else goto __pyx_L5_argtuple_error;
21698 CYTHON_FALLTHROUGH;
21700 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
21702 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
21704 CYTHON_FALLTHROUGH;
21706 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
21708 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
21711 if (unlikely(kw_args > 0)) {
21712 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
21714 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
21715 goto __pyx_L5_argtuple_error;
21717 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21718 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21719 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21721 __pyx_v___pyx_type = values[0];
21722 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
21723 __pyx_v___pyx_state = values[2];
21725 goto __pyx_L4_argument_unpacking_done;
21726 __pyx_L5_argtuple_error:;
21727 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
21729 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21730 __Pyx_RefNannyFinishContext();
21732 __pyx_L4_argument_unpacking_done:;
21733 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
21736 __Pyx_RefNannyFinishContext();
21740 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
21741 PyObject *__pyx_v___pyx_PickleError = NULL;
21742 PyObject *__pyx_v___pyx_result = NULL;
21743 PyObject *__pyx_r = NULL;
21744 __Pyx_RefNannyDeclarations
21746 PyObject *__pyx_t_2 = NULL;
21747 PyObject *__pyx_t_3 = NULL;
21748 PyObject *__pyx_t_4 = NULL;
21749 PyObject *__pyx_t_5 = NULL;
21750 PyObject *__pyx_t_6 = NULL;
21752 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
21760 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
21770 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
21771 __Pyx_GOTREF(__pyx_t_2);
21772 __Pyx_INCREF(__pyx_n_s_PickleError);
21773 __Pyx_GIVEREF(__pyx_n_s_PickleError);
21774 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
21775 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
21776 __Pyx_GOTREF(__pyx_t_3);
21777 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21778 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
21779 __Pyx_GOTREF(__pyx_t_2);
21780 __Pyx_INCREF(__pyx_t_2);
21781 __pyx_v___pyx_PickleError = __pyx_t_2;
21782 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21783 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21792 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error)
21793 __Pyx_GOTREF(__pyx_t_2);
21794 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
21795 __Pyx_GOTREF(__pyx_t_4);
21796 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21797 __Pyx_INCREF(__pyx_v___pyx_PickleError);
21798 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
21799 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21800 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
21801 if (likely(__pyx_t_5)) {
21802 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
21803 __Pyx_INCREF(__pyx_t_5);
21804 __Pyx_INCREF(
function);
21805 __Pyx_DECREF_SET(__pyx_t_2,
function);
21809 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
21810 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21811 __Pyx_GOTREF(__pyx_t_3);
21813 #if CYTHON_FAST_PYCALL
21814 if (PyFunction_Check(__pyx_t_2)) {
21815 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
21816 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
21817 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21818 __Pyx_GOTREF(__pyx_t_3);
21819 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21822 #if CYTHON_FAST_PYCCALL
21823 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
21824 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
21825 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
21826 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21827 __Pyx_GOTREF(__pyx_t_3);
21828 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21832 __pyx_t_6 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4, __pyx_L1_error)
21833 __Pyx_GOTREF(__pyx_t_6);
21834 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
21835 __Pyx_GIVEREF(__pyx_t_4);
21836 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
21838 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
21839 __Pyx_GOTREF(__pyx_t_3);
21840 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21843 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21844 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21845 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21846 __PYX_ERR(1, 4, __pyx_L1_error)
21863 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21864 __Pyx_GOTREF(__pyx_t_2);
21866 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21867 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
21868 if (likely(__pyx_t_6)) {
21869 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
21870 __Pyx_INCREF(__pyx_t_6);
21871 __Pyx_INCREF(
function);
21872 __Pyx_DECREF_SET(__pyx_t_2,
function);
21876 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21877 __Pyx_GOTREF(__pyx_t_3);
21879 #if CYTHON_FAST_PYCALL
21880 if (PyFunction_Check(__pyx_t_2)) {
21881 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
21882 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21883 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21884 __Pyx_GOTREF(__pyx_t_3);
21887 #if CYTHON_FAST_PYCCALL
21888 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
21889 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
21890 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21891 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21892 __Pyx_GOTREF(__pyx_t_3);
21896 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
21897 __Pyx_GOTREF(__pyx_t_4);
21898 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
21899 __Pyx_INCREF(__pyx_v___pyx_type);
21900 __Pyx_GIVEREF(__pyx_v___pyx_type);
21901 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
21902 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21903 __Pyx_GOTREF(__pyx_t_3);
21904 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21907 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21908 __pyx_v___pyx_result = __pyx_t_3;
21918 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21919 __pyx_t_7 = (__pyx_t_1 != 0);
21929 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 7, __pyx_L1_error)
21930 __pyx_t_3 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
21931 __Pyx_GOTREF(__pyx_t_3);
21932 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21950 __Pyx_XDECREF(__pyx_r);
21951 __Pyx_INCREF(__pyx_v___pyx_result);
21952 __pyx_r = __pyx_v___pyx_result;
21963 __Pyx_XDECREF(__pyx_t_2);
21964 __Pyx_XDECREF(__pyx_t_3);
21965 __Pyx_XDECREF(__pyx_t_4);
21966 __Pyx_XDECREF(__pyx_t_5);
21967 __Pyx_XDECREF(__pyx_t_6);
21968 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21971 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21972 __Pyx_XDECREF(__pyx_v___pyx_result);
21973 __Pyx_XGIVEREF(__pyx_r);
21974 __Pyx_RefNannyFinishContext();
21986 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21987 PyObject *__pyx_r = NULL;
21988 __Pyx_RefNannyDeclarations
21989 PyObject *__pyx_t_1 = NULL;
21991 Py_ssize_t __pyx_t_3;
21994 PyObject *__pyx_t_6 = NULL;
21995 PyObject *__pyx_t_7 = NULL;
21996 PyObject *__pyx_t_8 = NULL;
21997 PyObject *__pyx_t_9 = NULL;
21998 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
22007 if (unlikely(__pyx_v___pyx_state == Py_None)) {
22008 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
22009 __PYX_ERR(1, 10, __pyx_L1_error)
22011 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
22012 __Pyx_GOTREF(__pyx_t_1);
22013 __Pyx_GIVEREF(__pyx_t_1);
22014 __Pyx_GOTREF(__pyx_v___pyx_result->name);
22015 __Pyx_DECREF(__pyx_v___pyx_result->name);
22016 __pyx_v___pyx_result->name = __pyx_t_1;
22025 if (unlikely(__pyx_v___pyx_state == Py_None)) {
22026 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
22027 __PYX_ERR(1, 11, __pyx_L1_error)
22029 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
22030 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
22033 __pyx_t_2 = __pyx_t_4;
22034 goto __pyx_L4_bool_binop_done;
22036 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
22037 __pyx_t_5 = (__pyx_t_4 != 0);
22038 __pyx_t_2 = __pyx_t_5;
22039 __pyx_L4_bool_binop_done:;
22047 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
22048 __Pyx_GOTREF(__pyx_t_6);
22049 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error)
22050 __Pyx_GOTREF(__pyx_t_7);
22051 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22052 if (unlikely(__pyx_v___pyx_state == Py_None)) {
22053 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
22054 __PYX_ERR(1, 12, __pyx_L1_error)
22056 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
22057 __Pyx_GOTREF(__pyx_t_6);
22059 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
22060 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
22061 if (likely(__pyx_t_8)) {
22062 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
22063 __Pyx_INCREF(__pyx_t_8);
22064 __Pyx_INCREF(
function);
22065 __Pyx_DECREF_SET(__pyx_t_7,
function);
22069 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
22070 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22071 __Pyx_GOTREF(__pyx_t_1);
22073 #if CYTHON_FAST_PYCALL
22074 if (PyFunction_Check(__pyx_t_7)) {
22075 PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
22076 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
22077 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22078 __Pyx_GOTREF(__pyx_t_1);
22079 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22082 #if CYTHON_FAST_PYCCALL
22083 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
22084 PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
22085 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
22086 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22087 __Pyx_GOTREF(__pyx_t_1);
22088 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22092 __pyx_t_9 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 12, __pyx_L1_error)
22093 __Pyx_GOTREF(__pyx_t_9);
22094 __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
22095 __Pyx_GIVEREF(__pyx_t_6);
22096 PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
22098 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
22099 __Pyx_GOTREF(__pyx_t_1);
22100 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22103 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22104 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22123 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22126 __Pyx_XDECREF(__pyx_t_1);
22127 __Pyx_XDECREF(__pyx_t_6);
22128 __Pyx_XDECREF(__pyx_t_7);
22129 __Pyx_XDECREF(__pyx_t_8);
22130 __Pyx_XDECREF(__pyx_t_9);
22131 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
22134 __Pyx_XGIVEREF(__pyx_r);
22135 __Pyx_RefNannyFinishContext();
22139 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
22141 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22142 o = (*t->tp_alloc)(t, 0);
22144 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22146 if (unlikely(!o))
return 0;
22147 if (unlikely(__pyx_pw_10csmoothers_10cASMFactor_1__cinit__(o, a, k) < 0))
goto bad;
22150 Py_DECREF(o); o = 0;
22154 static void __pyx_tp_dealloc_10csmoothers_cASMFactor(PyObject *o) {
22155 #if CYTHON_USE_TP_FINALIZE
22156 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22157 if (PyObject_CallFinalizerFromDealloc(o))
return;
22161 PyObject *etype, *eval, *etb;
22162 PyErr_Fetch(&etype, &eval, &etb);
22164 __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(o);
22166 PyErr_Restore(etype, eval, etb);
22168 (*Py_TYPE(o)->tp_free)(o);
22171 static PyMethodDef __pyx_methods_10csmoothers_cASMFactor[] = {
22172 {
"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__, METH_NOARGS, 0},
22173 {
"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__, METH_O, 0},
22177 static PyTypeObject __pyx_type_10csmoothers_cASMFactor = {
22178 PyVarObject_HEAD_INIT(0, 0)
22179 "csmoothers.cASMFactor",
22180 sizeof(
struct __pyx_obj_10csmoothers_cASMFactor),
22182 __pyx_tp_dealloc_10csmoothers_cASMFactor,
22186 #
if PY_MAJOR_VERSION < 3
22189 #
if PY_MAJOR_VERSION >= 3
22202 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
22210 __pyx_methods_10csmoothers_cASMFactor,
22220 __pyx_tp_new_10csmoothers_cASMFactor,
22230 #
if PY_VERSION_HEX >= 0x030400a1
22235 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
22237 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22238 o = (*t->tp_alloc)(t, 0);
22240 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22242 if (unlikely(!o))
return 0;
22243 if (unlikely(__pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(o, a, k) < 0))
goto bad;
22246 Py_DECREF(o); o = 0;
22250 static void __pyx_tp_dealloc_10csmoothers_cBASMFactor(PyObject *o) {
22251 #if CYTHON_USE_TP_FINALIZE
22252 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22253 if (PyObject_CallFinalizerFromDealloc(o))
return;
22257 PyObject *etype, *eval, *etb;
22258 PyErr_Fetch(&etype, &eval, &etb);
22260 __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(o);
22262 PyErr_Restore(etype, eval, etb);
22264 (*Py_TYPE(o)->tp_free)(o);
22267 static PyMethodDef __pyx_methods_10csmoothers_cBASMFactor[] = {
22268 {
"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__, METH_NOARGS, 0},
22269 {
"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__, METH_O, 0},
22273 static PyTypeObject __pyx_type_10csmoothers_cBASMFactor = {
22274 PyVarObject_HEAD_INIT(0, 0)
22275 "csmoothers.cBASMFactor",
22276 sizeof(
struct __pyx_obj_10csmoothers_cBASMFactor),
22278 __pyx_tp_dealloc_10csmoothers_cBASMFactor,
22282 #
if PY_MAJOR_VERSION < 3
22285 #
if PY_MAJOR_VERSION >= 3
22298 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
22306 __pyx_methods_10csmoothers_cBASMFactor,
22316 __pyx_tp_new_10csmoothers_cBASMFactor,
22326 #
if PY_VERSION_HEX >= 0x030400a1
22330 static struct __pyx_vtabstruct_array __pyx_vtable_array;
22332 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
22333 struct __pyx_array_obj *p;
22335 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22336 o = (*t->tp_alloc)(t, 0);
22338 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22340 if (unlikely(!o))
return 0;
22341 p = ((
struct __pyx_array_obj *)o);
22342 p->__pyx_vtab = __pyx_vtabptr_array;
22343 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
22344 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
22345 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
22348 Py_DECREF(o); o = 0;
22352 static void __pyx_tp_dealloc_array(PyObject *o) {
22353 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
22354 #if CYTHON_USE_TP_FINALIZE
22355 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22356 if (PyObject_CallFinalizerFromDealloc(o))
return;
22360 PyObject *etype, *eval, *etb;
22361 PyErr_Fetch(&etype, &eval, &etb);
22363 __pyx_array___dealloc__(o);
22365 PyErr_Restore(etype, eval, etb);
22368 Py_CLEAR(p->_format);
22369 (*Py_TYPE(o)->tp_free)(o);
22371 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
22373 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
22374 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22379 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
22381 return __pyx_array___setitem__(o, i,
v);
22384 PyErr_Format(PyExc_NotImplementedError,
22385 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22390 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
22391 PyObject *
v = __Pyx_PyObject_GenericGetAttr(o,
n);
22392 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
22394 v = __pyx_array___getattr__(o,
n);
22399 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
22400 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
22403 static PyMethodDef __pyx_methods_array[] = {
22404 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
22405 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
22406 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
22410 static struct PyGetSetDef __pyx_getsets_array[] = {
22411 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
22415 static PySequenceMethods __pyx_tp_as_sequence_array = {
22416 __pyx_array___len__,
22419 __pyx_sq_item_array,
22428 static PyMappingMethods __pyx_tp_as_mapping_array = {
22429 __pyx_array___len__,
22430 __pyx_array___getitem__,
22431 __pyx_mp_ass_subscript_array,
22434 static PyBufferProcs __pyx_tp_as_buffer_array = {
22435 #if PY_MAJOR_VERSION < 3
22438 #if PY_MAJOR_VERSION < 3
22441 #if PY_MAJOR_VERSION < 3
22444 #if PY_MAJOR_VERSION < 3
22447 __pyx_array_getbuffer,
22451 static PyTypeObject __pyx_type___pyx_array = {
22452 PyVarObject_HEAD_INIT(0, 0)
22453 "csmoothers.array",
22454 sizeof(
struct __pyx_array_obj),
22456 __pyx_tp_dealloc_array,
22460 #
if PY_MAJOR_VERSION < 3
22463 #
if PY_MAJOR_VERSION >= 3
22468 &__pyx_tp_as_sequence_array,
22469 &__pyx_tp_as_mapping_array,
22473 __pyx_tp_getattro_array,
22475 &__pyx_tp_as_buffer_array,
22476 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
22484 __pyx_methods_array,
22486 __pyx_getsets_array,
22494 __pyx_tp_new_array,
22504 #
if PY_VERSION_HEX >= 0x030400a1
22509 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22510 struct __pyx_MemviewEnum_obj *p;
22512 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22513 o = (*t->tp_alloc)(t, 0);
22515 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22517 if (unlikely(!o))
return 0;
22518 p = ((
struct __pyx_MemviewEnum_obj *)o);
22519 p->name = Py_None; Py_INCREF(Py_None);
22523 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22524 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22525 #if CYTHON_USE_TP_FINALIZE
22526 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22527 if (PyObject_CallFinalizerFromDealloc(o))
return;
22530 PyObject_GC_UnTrack(o);
22532 (*Py_TYPE(o)->tp_free)(o);
22535 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
22537 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22539 e = (*v)(p->name, a);
if (e)
return e;
22544 static int __pyx_tp_clear_Enum(PyObject *o) {
22546 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
22547 tmp = ((PyObject*)p->name);
22548 p->name = Py_None; Py_INCREF(Py_None);
22553 static PyMethodDef __pyx_methods_Enum[] = {
22554 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22555 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22559 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22560 PyVarObject_HEAD_INIT(0, 0)
22562 sizeof(
struct __pyx_MemviewEnum_obj),
22564 __pyx_tp_dealloc_Enum,
22568 #
if PY_MAJOR_VERSION < 3
22571 #
if PY_MAJOR_VERSION >= 3
22574 __pyx_MemviewEnum___repr__,
22584 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22586 __pyx_tp_traverse_Enum,
22587 __pyx_tp_clear_Enum,
22592 __pyx_methods_Enum,
22600 __pyx_MemviewEnum___init__,
22612 #
if PY_VERSION_HEX >= 0x030400a1
22616 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22618 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22619 struct __pyx_memoryview_obj *p;
22621 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22622 o = (*t->tp_alloc)(t, 0);
22624 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22626 if (unlikely(!o))
return 0;
22627 p = ((
struct __pyx_memoryview_obj *)o);
22628 p->__pyx_vtab = __pyx_vtabptr_memoryview;
22629 p->obj = Py_None; Py_INCREF(Py_None);
22630 p->_size = Py_None; Py_INCREF(Py_None);
22631 p->_array_interface = Py_None; Py_INCREF(Py_None);
22632 p->view.obj = NULL;
22633 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
22636 Py_DECREF(o); o = 0;
22640 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22641 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22642 #if CYTHON_USE_TP_FINALIZE
22643 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22644 if (PyObject_CallFinalizerFromDealloc(o))
return;
22647 PyObject_GC_UnTrack(o);
22649 PyObject *etype, *eval, *etb;
22650 PyErr_Fetch(&etype, &eval, &etb);
22652 __pyx_memoryview___dealloc__(o);
22654 PyErr_Restore(etype, eval, etb);
22657 Py_CLEAR(p->_size);
22658 Py_CLEAR(p->_array_interface);
22659 (*Py_TYPE(o)->tp_free)(o);
22662 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
22664 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22666 e = (*v)(p->obj, a);
if (e)
return e;
22669 e = (*v)(p->_size, a);
if (e)
return e;
22671 if (p->_array_interface) {
22672 e = (*v)(p->_array_interface, a);
if (e)
return e;
22675 e = (*v)(p->view.obj, a);
if (e)
return e;
22680 static int __pyx_tp_clear_memoryview(PyObject *o) {
22682 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22683 tmp = ((PyObject*)p->obj);
22684 p->obj = Py_None; Py_INCREF(Py_None);
22686 tmp = ((PyObject*)p->_size);
22687 p->_size = Py_None; Py_INCREF(Py_None);
22689 tmp = ((PyObject*)p->_array_interface);
22690 p->_array_interface = Py_None; Py_INCREF(Py_None);
22692 Py_CLEAR(p->view.obj);
22695 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22697 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
22698 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22703 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
22705 return __pyx_memoryview___setitem__(o, i,
v);
22708 PyErr_Format(PyExc_NotImplementedError,
22709 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22714 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
22715 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22718 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
22719 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22722 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
22723 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22726 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
22727 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22730 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
22731 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22734 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
22735 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22738 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
22739 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22742 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
22743 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22746 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
22747 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22750 static PyMethodDef __pyx_methods_memoryview[] = {
22751 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22752 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22753 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22754 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22755 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22756 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22760 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22761 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
22762 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
22763 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
22764 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
22765 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
22766 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
22767 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
22768 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
22769 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
22773 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22774 __pyx_memoryview___len__,
22777 __pyx_sq_item_memoryview,
22786 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22787 __pyx_memoryview___len__,
22788 __pyx_memoryview___getitem__,
22789 __pyx_mp_ass_subscript_memoryview,
22792 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22793 #if PY_MAJOR_VERSION < 3
22796 #if PY_MAJOR_VERSION < 3
22799 #if PY_MAJOR_VERSION < 3
22802 #if PY_MAJOR_VERSION < 3
22805 __pyx_memoryview_getbuffer,
22809 static PyTypeObject __pyx_type___pyx_memoryview = {
22810 PyVarObject_HEAD_INIT(0, 0)
22811 "csmoothers.memoryview",
22812 sizeof(
struct __pyx_memoryview_obj),
22814 __pyx_tp_dealloc_memoryview,
22818 #
if PY_MAJOR_VERSION < 3
22821 #
if PY_MAJOR_VERSION >= 3
22824 __pyx_memoryview___repr__,
22826 &__pyx_tp_as_sequence_memoryview,
22827 &__pyx_tp_as_mapping_memoryview,
22830 __pyx_memoryview___str__,
22833 &__pyx_tp_as_buffer_memoryview,
22834 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22836 __pyx_tp_traverse_memoryview,
22837 __pyx_tp_clear_memoryview,
22842 __pyx_methods_memoryview,
22844 __pyx_getsets_memoryview,
22852 __pyx_tp_new_memoryview,
22862 #
if PY_VERSION_HEX >= 0x030400a1
22866 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22868 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22869 struct __pyx_memoryviewslice_obj *p;
22870 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22871 if (unlikely(!o))
return 0;
22872 p = ((
struct __pyx_memoryviewslice_obj *)o);
22873 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22874 p->from_object = Py_None; Py_INCREF(Py_None);
22875 p->from_slice.memview = NULL;
22879 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22880 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22881 #if CYTHON_USE_TP_FINALIZE
22882 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22883 if (PyObject_CallFinalizerFromDealloc(o))
return;
22886 PyObject_GC_UnTrack(o);
22888 PyObject *etype, *eval, *etb;
22889 PyErr_Fetch(&etype, &eval, &etb);
22891 __pyx_memoryviewslice___dealloc__(o);
22893 PyErr_Restore(etype, eval, etb);
22895 Py_CLEAR(p->from_object);
22896 PyObject_GC_Track(o);
22897 __pyx_tp_dealloc_memoryview(o);
22900 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
22902 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22903 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
22904 if (p->from_object) {
22905 e = (*v)(p->from_object, a);
if (e)
return e;
22910 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22912 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22913 __pyx_tp_clear_memoryview(o);
22914 tmp = ((PyObject*)p->from_object);
22915 p->from_object = Py_None; Py_INCREF(Py_None);
22917 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22921 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
22922 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22925 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22926 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22927 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22931 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22932 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
22936 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22937 PyVarObject_HEAD_INIT(0, 0)
22938 "csmoothers._memoryviewslice",
22939 sizeof(
struct __pyx_memoryviewslice_obj),
22941 __pyx_tp_dealloc__memoryviewslice,
22945 #
if PY_MAJOR_VERSION < 3
22948 #
if PY_MAJOR_VERSION >= 3
22951 #
if CYTHON_COMPILING_IN_PYPY
22952 __pyx_memoryview___repr__,
22961 #
if CYTHON_COMPILING_IN_PYPY
22962 __pyx_memoryview___str__,
22969 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22970 "Internal class for passing memoryview slices to Python",
22971 __pyx_tp_traverse__memoryviewslice,
22972 __pyx_tp_clear__memoryviewslice,
22977 __pyx_methods__memoryviewslice,
22979 __pyx_getsets__memoryviewslice,
22987 __pyx_tp_new__memoryviewslice,
22997 #
if PY_VERSION_HEX >= 0x030400a1
23002 static PyMethodDef __pyx_methods[] = {
23006 #if PY_MAJOR_VERSION >= 3
23007 #if CYTHON_PEP489_MULTI_PHASE_INIT
23008 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
23009 static int __pyx_pymod_exec_csmoothers(PyObject* module);
23010 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
23011 {Py_mod_create, (
void*)__pyx_pymod_create},
23012 {Py_mod_exec, (
void*)__pyx_pymod_exec_csmoothers},
23017 static struct PyModuleDef __pyx_moduledef = {
23018 PyModuleDef_HEAD_INIT,
23021 #if CYTHON_PEP489_MULTI_PHASE_INIT
23027 #if CYTHON_PEP489_MULTI_PHASE_INIT
23028 __pyx_moduledef_slots,
23038 static __Pyx_StringTabEntry __pyx_string_tab[] = {
23039 {&__pyx_n_s_A, __pyx_k_A,
sizeof(__pyx_k_A), 0, 0, 1, 1},
23040 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
23041 {&__pyx_n_s_ASMFactor, __pyx_k_ASMFactor,
sizeof(__pyx_k_ASMFactor), 0, 0, 1, 1},
23042 {&__pyx_n_s_ASMFactor___init, __pyx_k_ASMFactor___init,
sizeof(__pyx_k_ASMFactor___init), 0, 0, 1, 1},
23043 {&__pyx_n_s_BASMFactor, __pyx_k_BASMFactor,
sizeof(__pyx_k_BASMFactor), 0, 0, 1, 1},
23044 {&__pyx_n_s_BASMFactor___init, __pyx_k_BASMFactor___init,
sizeof(__pyx_k_BASMFactor___init), 0, 0, 1, 1},
23045 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
23046 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
23047 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
23048 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
23049 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
23050 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
23051 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
23052 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor,
sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
23053 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2,
sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
23054 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
23055 {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
23056 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
23057 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
23058 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
23059 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
23060 {&__pyx_n_s_L, __pyx_k_L,
sizeof(__pyx_k_L), 0, 0, 1, 1},
23061 {&__pyx_n_s_M, __pyx_k_M,
sizeof(__pyx_k_M), 0, 0, 1, 1},
23062 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
23063 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
23064 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
23065 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor,
sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
23066 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
23067 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
23068 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
23069 {&__pyx_n_s_R, __pyx_k_R,
sizeof(__pyx_k_R), 0, 0, 1, 1},
23070 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
23071 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
23072 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
23073 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
23074 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
23075 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
23076 {&__pyx_n_s_asmFactor, __pyx_k_asmFactor,
sizeof(__pyx_k_asmFactor), 0, 0, 1, 1},
23077 {&__pyx_n_s_asm_NR_prepare, __pyx_k_asm_NR_prepare,
sizeof(__pyx_k_asm_NR_prepare), 0, 0, 1, 1},
23078 {&__pyx_n_s_asm_NR_solve, __pyx_k_asm_NR_solve,
sizeof(__pyx_k_asm_NR_solve), 0, 0, 1, 1},
23079 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
23080 {&__pyx_n_s_basmFactor, __pyx_k_basmFactor,
sizeof(__pyx_k_basmFactor), 0, 0, 1, 1},
23081 {&__pyx_n_s_basm_NR_prepare, __pyx_k_basm_NR_prepare,
sizeof(__pyx_k_basm_NR_prepare), 0, 0, 1, 1},
23082 {&__pyx_n_s_basm_NR_solve, __pyx_k_basm_NR_solve,
sizeof(__pyx_k_basm_NR_solve), 0, 0, 1, 1},
23083 {&__pyx_n_s_bs, __pyx_k_bs,
sizeof(__pyx_k_bs), 0, 0, 1, 1},
23084 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
23085 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
23086 {&__pyx_n_s_cASMFactor, __pyx_k_cASMFactor,
sizeof(__pyx_k_cASMFactor), 0, 0, 1, 1},
23087 {&__pyx_n_s_cBASMFactor, __pyx_k_cBASMFactor,
sizeof(__pyx_k_cBASMFactor), 0, 0, 1, 1},
23088 {&__pyx_n_s_cSparseMatrix, __pyx_k_cSparseMatrix,
sizeof(__pyx_k_cSparseMatrix), 0, 0, 1, 1},
23089 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
23090 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
23091 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
23092 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
23093 {&__pyx_n_s_csmoothers, __pyx_k_csmoothers,
sizeof(__pyx_k_csmoothers), 0, 0, 1, 1},
23094 {&__pyx_n_s_dX, __pyx_k_dX,
sizeof(__pyx_k_dX), 0, 0, 1, 1},
23095 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
23096 {&__pyx_n_s_doc, __pyx_k_doc,
sizeof(__pyx_k_doc), 0, 0, 1, 1},
23097 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
23098 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
23099 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
23100 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
23101 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
23102 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
23103 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
23104 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
23105 {&__pyx_n_s_gauss_seidel_NR_preare, __pyx_k_gauss_seidel_NR_preare,
sizeof(__pyx_k_gauss_seidel_NR_preare), 0, 0, 1, 1},
23106 {&__pyx_n_s_gauss_seidel_NR_solve, __pyx_k_gauss_seidel_NR_solve,
sizeof(__pyx_k_gauss_seidel_NR_solve), 0, 0, 1, 1},
23107 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
23108 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
23109 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
23110 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
23111 {&__pyx_n_s_init, __pyx_k_init,
sizeof(__pyx_k_init), 0, 0, 1, 1},
23112 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
23113 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
23114 {&__pyx_n_s_jacobi_NR_prepare, __pyx_k_jacobi_NR_prepare,
sizeof(__pyx_k_jacobi_NR_prepare), 0, 0, 1, 1},
23115 {&__pyx_n_s_jacobi_NR_solve, __pyx_k_jacobi_NR_solve,
sizeof(__pyx_k_jacobi_NR_solve), 0, 0, 1, 1},
23116 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
23117 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
23118 {&__pyx_n_s_metaclass, __pyx_k_metaclass,
sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
23119 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
23120 {&__pyx_n_s_module, __pyx_k_module,
sizeof(__pyx_k_module), 0, 0, 1, 1},
23121 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
23122 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
23123 {&__pyx_n_s_nc, __pyx_k_nc,
sizeof(__pyx_k_nc), 0, 0, 1, 1},
23124 {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous,
sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
23125 {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou,
sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
23126 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
23127 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
23128 {&__pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_k_nl_gauss_seidel_NR_solve,
sizeof(__pyx_k_nl_gauss_seidel_NR_solve), 0, 0, 1, 1},
23129 {&__pyx_n_s_nl_jacobi_NR_solve, __pyx_k_nl_jacobi_NR_solve,
sizeof(__pyx_k_nl_jacobi_NR_solve), 0, 0, 1, 1},
23130 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
23131 {&__pyx_n_s_node_order, __pyx_k_node_order,
sizeof(__pyx_k_node_order), 0, 0, 1, 1},
23132 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
23133 {&__pyx_n_s_nr, __pyx_k_nr,
sizeof(__pyx_k_nr), 0, 0, 1, 1},
23134 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
23135 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
23136 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
23137 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
23138 {&__pyx_n_s_object, __pyx_k_object,
sizeof(__pyx_k_object), 0, 0, 1, 1},
23139 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
23140 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
23141 {&__pyx_n_s_prepare, __pyx_k_prepare,
sizeof(__pyx_k_prepare), 0, 0, 1, 1},
23142 {&__pyx_kp_s_proteus_csmoothers_pyx, __pyx_k_proteus_csmoothers_pyx,
sizeof(__pyx_k_proteus_csmoothers_pyx), 0, 0, 1, 0},
23143 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
23144 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
23145 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
23146 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
23147 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
23148 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
23149 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
23150 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
23151 {&__pyx_n_s_qualname, __pyx_k_qualname,
sizeof(__pyx_k_qualname), 0, 0, 1, 1},
23152 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
23153 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
23154 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
23155 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
23156 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
23157 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
23158 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
23159 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
23160 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
23161 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
23162 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
23163 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
23164 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
23165 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
23166 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
23167 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
23168 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
23169 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
23170 {&__pyx_n_s_tol, __pyx_k_tol,
sizeof(__pyx_k_tol), 0, 0, 1, 1},
23171 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
23172 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
23173 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd,
sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
23174 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
23175 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
23176 {&__pyx_n_s_w, __pyx_k_w,
sizeof(__pyx_k_w), 0, 0, 1, 1},
23177 {0, 0, 0, 0, 0, 0, 0}
23179 static int __Pyx_InitCachedBuiltins(
void) {
23180 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object);
if (!__pyx_builtin_object) __PYX_ERR(0, 5, __pyx_L1_error)
23181 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
23182 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(2, 229, __pyx_L1_error)
23183 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(2, 242, __pyx_L1_error)
23184 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 810, __pyx_L1_error)
23185 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1000, __pyx_L1_error)
23186 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 147, __pyx_L1_error)
23187 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 150, __pyx_L1_error)
23188 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 399, __pyx_L1_error)
23189 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 608, __pyx_L1_error)
23190 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 827, __pyx_L1_error)
23196 static int __Pyx_InitCachedConstants(
void) {
23197 __Pyx_RefNannyDeclarations
23198 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
23206 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error)
23207 __Pyx_GOTREF(__pyx_tuple_);
23208 __Pyx_GIVEREF(__pyx_tuple_);
23215 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error)
23216 __Pyx_GOTREF(__pyx_tuple__2);
23217 __Pyx_GIVEREF(__pyx_tuple__2);
23225 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
23226 __Pyx_GOTREF(__pyx_tuple__3);
23227 __Pyx_GIVEREF(__pyx_tuple__3);
23234 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
23235 __Pyx_GOTREF(__pyx_tuple__4);
23236 __Pyx_GIVEREF(__pyx_tuple__4);
23245 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 229, __pyx_L1_error)
23246 __Pyx_GOTREF(__pyx_tuple__5);
23247 __Pyx_GIVEREF(__pyx_tuple__5);
23256 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 233, __pyx_L1_error)
23257 __Pyx_GOTREF(__pyx_tuple__6);
23258 __Pyx_GIVEREF(__pyx_tuple__6);
23267 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 263, __pyx_L1_error)
23268 __Pyx_GOTREF(__pyx_tuple__7);
23269 __Pyx_GIVEREF(__pyx_tuple__7);
23278 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 810, __pyx_L1_error)
23279 __Pyx_GOTREF(__pyx_tuple__8);
23280 __Pyx_GIVEREF(__pyx_tuple__8);
23289 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 814, __pyx_L1_error)
23290 __Pyx_GOTREF(__pyx_tuple__9);
23291 __Pyx_GIVEREF(__pyx_tuple__9);
23300 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 834, __pyx_L1_error)
23301 __Pyx_GOTREF(__pyx_tuple__10);
23302 __Pyx_GIVEREF(__pyx_tuple__10);
23311 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 1000, __pyx_L1_error)
23312 __Pyx_GOTREF(__pyx_tuple__11);
23313 __Pyx_GIVEREF(__pyx_tuple__11);
23322 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 1006, __pyx_L1_error)
23323 __Pyx_GOTREF(__pyx_tuple__12);
23324 __Pyx_GIVEREF(__pyx_tuple__12);
23331 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 1012, __pyx_L1_error)
23332 __Pyx_GOTREF(__pyx_tuple__13);
23333 __Pyx_GIVEREF(__pyx_tuple__13);
23342 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 132, __pyx_L1_error)
23343 __Pyx_GOTREF(__pyx_tuple__14);
23344 __Pyx_GIVEREF(__pyx_tuple__14);
23353 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 135, __pyx_L1_error)
23354 __Pyx_GOTREF(__pyx_tuple__15);
23355 __Pyx_GIVEREF(__pyx_tuple__15);
23364 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_ASCII);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 138, __pyx_L1_error)
23365 __Pyx_GOTREF(__pyx_tuple__16);
23366 __Pyx_GIVEREF(__pyx_tuple__16);
23375 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 147, __pyx_L1_error)
23376 __Pyx_GOTREF(__pyx_tuple__17);
23377 __Pyx_GIVEREF(__pyx_tuple__17);
23386 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 175, __pyx_L1_error)
23387 __Pyx_GOTREF(__pyx_tuple__18);
23388 __Pyx_GIVEREF(__pyx_tuple__18);
23397 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 191, __pyx_L1_error)
23398 __Pyx_GOTREF(__pyx_tuple__19);
23399 __Pyx_GIVEREF(__pyx_tuple__19);
23407 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 2, __pyx_L1_error)
23408 __Pyx_GOTREF(__pyx_tuple__20);
23409 __Pyx_GIVEREF(__pyx_tuple__20);
23416 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error)
23417 __Pyx_GOTREF(__pyx_tuple__21);
23418 __Pyx_GIVEREF(__pyx_tuple__21);
23427 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 413, __pyx_L1_error)
23428 __Pyx_GOTREF(__pyx_tuple__22);
23429 __Pyx_GIVEREF(__pyx_tuple__22);
23438 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 490, __pyx_L1_error)
23439 __Pyx_GOTREF(__pyx_tuple__23);
23440 __Pyx_GIVEREF(__pyx_tuple__23);
23449 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 515, __pyx_L1_error)
23450 __Pyx_GOTREF(__pyx_tuple__24);
23451 __Pyx_GIVEREF(__pyx_tuple__24);
23460 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 565, __pyx_L1_error)
23461 __Pyx_GOTREF(__pyx_tuple__25);
23462 __Pyx_GIVEREF(__pyx_tuple__25);
23471 __pyx_tuple__26 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 572, __pyx_L1_error)
23472 __Pyx_GOTREF(__pyx_tuple__26);
23473 __Pyx_INCREF(__pyx_int_neg_1);
23474 __Pyx_GIVEREF(__pyx_int_neg_1);
23475 PyTuple_SET_ITEM(__pyx_tuple__26, 0, __pyx_int_neg_1);
23476 __Pyx_GIVEREF(__pyx_tuple__26);
23484 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 2, __pyx_L1_error)
23485 __Pyx_GOTREF(__pyx_tuple__27);
23486 __Pyx_GIVEREF(__pyx_tuple__27);
23493 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 4, __pyx_L1_error)
23494 __Pyx_GOTREF(__pyx_tuple__28);
23495 __Pyx_GIVEREF(__pyx_tuple__28);
23504 __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__29)) __PYX_ERR(1, 677, __pyx_L1_error)
23505 __Pyx_GOTREF(__pyx_slice__29);
23506 __Pyx_GIVEREF(__pyx_slice__29);
23515 __pyx_slice__30 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__30)) __PYX_ERR(1, 680, __pyx_L1_error)
23516 __Pyx_GOTREF(__pyx_slice__30);
23517 __Pyx_GIVEREF(__pyx_slice__30);
23526 __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__31)) __PYX_ERR(1, 691, __pyx_L1_error)
23527 __Pyx_GOTREF(__pyx_slice__31);
23528 __Pyx_GIVEREF(__pyx_slice__31);
23537 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 698, __pyx_L1_error)
23538 __Pyx_GOTREF(__pyx_tuple__32);
23539 __Pyx_GIVEREF(__pyx_tuple__32);
23547 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 2, __pyx_L1_error)
23548 __Pyx_GOTREF(__pyx_tuple__33);
23549 __Pyx_GIVEREF(__pyx_tuple__33);
23556 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 4, __pyx_L1_error)
23557 __Pyx_GOTREF(__pyx_tuple__34);
23558 __Pyx_GIVEREF(__pyx_tuple__34);
23567 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_builtin_object);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 5, __pyx_L1_error)
23568 __Pyx_GOTREF(__pyx_tuple__35);
23569 __Pyx_GIVEREF(__pyx_tuple__35);
23578 __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_L);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 7, __pyx_L1_error)
23579 __Pyx_GOTREF(__pyx_tuple__36);
23580 __Pyx_GIVEREF(__pyx_tuple__36);
23581 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 7, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 7, __pyx_L1_error)
23590 __pyx_tuple__38 = PyTuple_Pack(1, __pyx_builtin_object);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 42, __pyx_L1_error)
23591 __Pyx_GOTREF(__pyx_tuple__38);
23592 __Pyx_GIVEREF(__pyx_tuple__38);
23601 __pyx_tuple__39 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_L, __pyx_n_s_bs);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 44, __pyx_L1_error)
23602 __Pyx_GOTREF(__pyx_tuple__39);
23603 __Pyx_GIVEREF(__pyx_tuple__39);
23604 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 44, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 44, __pyx_L1_error)
23613 __pyx_tuple__41 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 84, __pyx_L1_error)
23614 __Pyx_GOTREF(__pyx_tuple__41);
23615 __Pyx_GIVEREF(__pyx_tuple__41);
23616 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_prepare, 84, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 84, __pyx_L1_error)
23625 __pyx_tuple__43 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 109, __pyx_L1_error)
23626 __Pyx_GOTREF(__pyx_tuple__43);
23627 __Pyx_GIVEREF(__pyx_tuple__43);
23628 __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_solve, 109, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 109, __pyx_L1_error)
23637 __pyx_tuple__45 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 136, __pyx_L1_error)
23638 __Pyx_GOTREF(__pyx_tuple__45);
23639 __Pyx_GIVEREF(__pyx_tuple__45);
23640 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_jacobi_NR_solve, 136, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 136, __pyx_L1_error)
23649 __pyx_tuple__47 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 165, __pyx_L1_error)
23650 __Pyx_GOTREF(__pyx_tuple__47);
23651 __Pyx_GIVEREF(__pyx_tuple__47);
23652 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_preare, 165, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 165, __pyx_L1_error)
23661 __pyx_tuple__49 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 190, __pyx_L1_error)
23662 __Pyx_GOTREF(__pyx_tuple__49);
23663 __Pyx_GIVEREF(__pyx_tuple__49);
23664 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_solve, 190, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 190, __pyx_L1_error)
23673 __pyx_tuple__51 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 217, __pyx_L1_error)
23674 __Pyx_GOTREF(__pyx_tuple__51);
23675 __Pyx_GIVEREF(__pyx_tuple__51);
23676 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_gauss_seidel_NR_solve, 217, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 217, __pyx_L1_error)
23685 __pyx_tuple__53 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_asmFactor);
if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 251, __pyx_L1_error)
23686 __Pyx_GOTREF(__pyx_tuple__53);
23687 __Pyx_GIVEREF(__pyx_tuple__53);
23688 __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_prepare, 251, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 251, __pyx_L1_error)
23697 __pyx_tuple__55 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_asmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 277, __pyx_L1_error)
23698 __Pyx_GOTREF(__pyx_tuple__55);
23699 __Pyx_GIVEREF(__pyx_tuple__55);
23700 __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_solve, 277, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 277, __pyx_L1_error)
23709 __pyx_tuple__57 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_basmFactor);
if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 321, __pyx_L1_error)
23710 __Pyx_GOTREF(__pyx_tuple__57);
23711 __Pyx_GIVEREF(__pyx_tuple__57);
23712 __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_prepare, 321, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 321, __pyx_L1_error)
23721 __pyx_tuple__59 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_basmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX);
if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 350, __pyx_L1_error)
23722 __Pyx_GOTREF(__pyx_tuple__59);
23723 __Pyx_GIVEREF(__pyx_tuple__59);
23724 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_solve, 350, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 350, __pyx_L1_error)
23733 __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 285, __pyx_L1_error)
23734 __Pyx_GOTREF(__pyx_tuple__61);
23735 __Pyx_GIVEREF(__pyx_tuple__61);
23744 __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 286, __pyx_L1_error)
23745 __Pyx_GOTREF(__pyx_tuple__62);
23746 __Pyx_GIVEREF(__pyx_tuple__62);
23755 __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__63)) __PYX_ERR(1, 287, __pyx_L1_error)
23756 __Pyx_GOTREF(__pyx_tuple__63);
23757 __Pyx_GIVEREF(__pyx_tuple__63);
23766 __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__64)) __PYX_ERR(1, 290, __pyx_L1_error)
23767 __Pyx_GOTREF(__pyx_tuple__64);
23768 __Pyx_GIVEREF(__pyx_tuple__64);
23777 __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__65)) __PYX_ERR(1, 291, __pyx_L1_error)
23778 __Pyx_GOTREF(__pyx_tuple__65);
23779 __Pyx_GIVEREF(__pyx_tuple__65);
23786 __pyx_tuple__66 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__66)) __PYX_ERR(1, 1, __pyx_L1_error)
23787 __Pyx_GOTREF(__pyx_tuple__66);
23788 __Pyx_GIVEREF(__pyx_tuple__66);
23789 __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(1, 1, __pyx_L1_error)
23790 __Pyx_RefNannyFinishContext();
23793 __Pyx_RefNannyFinishContext();
23797 static int __Pyx_InitGlobals(
void) {
23798 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23799 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23800 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23801 __pyx_int_184977713 = PyInt_FromLong(184977713
L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23802 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23808 static int __Pyx_modinit_global_init_code(
void);
23809 static int __Pyx_modinit_variable_export_code(
void);
23810 static int __Pyx_modinit_function_export_code(
void);
23811 static int __Pyx_modinit_type_init_code(
void);
23812 static int __Pyx_modinit_type_import_code(
void);
23813 static int __Pyx_modinit_variable_import_code(
void);
23814 static int __Pyx_modinit_function_import_code(
void);
23816 static int __Pyx_modinit_global_init_code(
void) {
23817 __Pyx_RefNannyDeclarations
23818 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
23820 generic = Py_None; Py_INCREF(Py_None);
23821 strided = Py_None; Py_INCREF(Py_None);
23822 indirect = Py_None; Py_INCREF(Py_None);
23823 contiguous = Py_None; Py_INCREF(Py_None);
23824 indirect_contiguous = Py_None; Py_INCREF(Py_None);
23825 __Pyx_RefNannyFinishContext();
23829 static int __Pyx_modinit_variable_export_code(
void) {
23830 __Pyx_RefNannyDeclarations
23831 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
23833 __Pyx_RefNannyFinishContext();
23837 static int __Pyx_modinit_function_export_code(
void) {
23838 __Pyx_RefNannyDeclarations
23839 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
23841 __Pyx_RefNannyFinishContext();
23845 static int __Pyx_modinit_type_init_code(
void) {
23846 __Pyx_RefNannyDeclarations
23847 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
23849 if (PyType_Ready(&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23850 __pyx_type_10csmoothers_cASMFactor.tp_print = 0;
23851 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
23852 __pyx_type_10csmoothers_cASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23854 if (PyObject_SetAttrString(__pyx_m,
"cASMFactor", (PyObject *)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23855 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
23856 __pyx_ptype_10csmoothers_cASMFactor = &__pyx_type_10csmoothers_cASMFactor;
23857 if (PyType_Ready(&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23858 __pyx_type_10csmoothers_cBASMFactor.tp_print = 0;
23859 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cBASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cBASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
23860 __pyx_type_10csmoothers_cBASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23862 if (PyObject_SetAttrString(__pyx_m,
"cBASMFactor", (PyObject *)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23863 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
23864 __pyx_ptype_10csmoothers_cBASMFactor = &__pyx_type_10csmoothers_cBASMFactor;
23865 __pyx_vtabptr_array = &__pyx_vtable_array;
23866 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
23867 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23868 __pyx_type___pyx_array.tp_print = 0;
23869 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23870 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23871 __pyx_array_type = &__pyx_type___pyx_array;
23872 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 278, __pyx_L1_error)
23873 __pyx_type___pyx_MemviewEnum.tp_print = 0;
23874 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23875 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23877 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 278, __pyx_L1_error)
23878 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23879 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23880 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23881 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23882 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23883 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23884 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23885 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
23886 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23887 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23888 __pyx_type___pyx_memoryview.tp_print = 0;
23889 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23890 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23892 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23893 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23894 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23895 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23896 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23897 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
23898 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23899 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23900 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23901 __pyx_type___pyx_memoryviewslice.tp_print = 0;
23902 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23903 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23905 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23906 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23907 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23908 __Pyx_RefNannyFinishContext();
23911 __Pyx_RefNannyFinishContext();
23915 static int __Pyx_modinit_type_import_code(
void) {
23916 __Pyx_RefNannyDeclarations
23917 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
23919 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME,
"type",
23920 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23921 sizeof(PyTypeObject),
23923 sizeof(PyHeapTypeObject),
23925 0);
if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error)
23926 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(
"numpy",
"dtype",
sizeof(PyArray_Descr), 0);
if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(2, 164, __pyx_L1_error)
23927 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(
"numpy",
"flatiter",
sizeof(PyArrayIterObject), 0);
if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 186, __pyx_L1_error)
23928 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), 0);
if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 190, __pyx_L1_error)
23929 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(
"numpy",
"ndarray",
sizeof(PyArrayObject), 0);
if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 199, __pyx_L1_error)
23930 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(
"numpy",
"ufunc",
sizeof(PyUFuncObject), 0);
if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 872, __pyx_L1_error)
23931 __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = __Pyx_ImportType(
"proteus.superluWrappers",
"cSparseMatrix",
sizeof(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix), 1);
if (unlikely(!__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix)) __PYX_ERR(4, 67, __pyx_L1_error)
23932 __Pyx_RefNannyFinishContext();
23935 __Pyx_RefNannyFinishContext();
23939 static int __Pyx_modinit_variable_import_code(
void) {
23940 __Pyx_RefNannyDeclarations
23941 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
23943 __Pyx_RefNannyFinishContext();
23947 static int __Pyx_modinit_function_import_code(
void) {
23948 __Pyx_RefNannyDeclarations
23949 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
23951 __Pyx_RefNannyFinishContext();
23956 #if PY_MAJOR_VERSION < 3
23957 #ifdef CYTHON_NO_PYINIT_EXPORT
23958 #define __Pyx_PyMODINIT_FUNC void
23960 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23963 #ifdef CYTHON_NO_PYINIT_EXPORT
23964 #define __Pyx_PyMODINIT_FUNC PyObject *
23966 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23969 #ifndef CYTHON_SMALL_CODE
23970 #if defined(__clang__)
23971 #define CYTHON_SMALL_CODE
23972 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
23973 #define CYTHON_SMALL_CODE __attribute__((cold))
23975 #define CYTHON_SMALL_CODE
23980 #if PY_MAJOR_VERSION < 3
23981 __Pyx_PyMODINIT_FUNC initcsmoothers(
void) CYTHON_SMALL_CODE;
23982 __Pyx_PyMODINIT_FUNC initcsmoothers(
void)
23984 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(
void) CYTHON_SMALL_CODE;
23985 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(
void)
23986 #if CYTHON_PEP489_MULTI_PHASE_INIT
23988 return PyModuleDef_Init(&__pyx_moduledef);
23990 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name) {
23991 PyObject *value = PyObject_GetAttrString(spec, from_name);
23993 if (likely(value)) {
23994 result = PyDict_SetItemString(moddict, to_name, value);
23996 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
24003 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
24004 PyObject *module = NULL, *moddict, *modname;
24006 return __Pyx_NewRef(__pyx_m);
24007 modname = PyObject_GetAttrString(spec,
"name");
24008 if (unlikely(!modname))
goto bad;
24009 module = PyModule_NewObject(modname);
24010 Py_DECREF(modname);
24011 if (unlikely(!module))
goto bad;
24012 moddict = PyModule_GetDict(module);
24013 if (unlikely(!moddict))
goto bad;
24014 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__") < 0))
goto bad;
24015 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__") < 0))
goto bad;
24016 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__") < 0))
goto bad;
24017 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__") < 0))
goto bad;
24020 Py_XDECREF(module);
24025 static int __pyx_pymod_exec_csmoothers(PyObject *__pyx_pyinit_module)
24029 PyObject *__pyx_t_1 = NULL;
24030 PyObject *__pyx_t_2 = NULL;
24031 PyObject *__pyx_t_3 = NULL;
24032 static PyThread_type_lock __pyx_t_4[8];
24033 __Pyx_RefNannyDeclarations
24034 #if CYTHON_PEP489_MULTI_PHASE_INIT
24035 if (__pyx_m && __pyx_m == __pyx_pyinit_module)
return 0;
24036 #elif PY_MAJOR_VERSION >= 3
24037 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
24039 #if CYTHON_REFNANNY
24040 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
24041 if (!__Pyx_RefNanny) {
24043 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
24044 if (!__Pyx_RefNanny)
24045 Py_FatalError(
"failed to import 'refnanny' module");
24048 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_csmoothers(void)", 0);
24049 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24050 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
24051 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
24052 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
24053 #ifdef __Pyx_CyFunction_USED
24054 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24056 #ifdef __Pyx_FusedFunction_USED
24057 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24059 #ifdef __Pyx_Coroutine_USED
24060 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24062 #ifdef __Pyx_Generator_USED
24063 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24065 #ifdef __Pyx_AsyncGen_USED
24066 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24068 #ifdef __Pyx_StopAsyncIteration_USED
24069 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24073 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
24075 PyEval_InitThreads();
24079 #if CYTHON_PEP489_MULTI_PHASE_INIT
24080 __pyx_m = __pyx_pyinit_module;
24081 Py_INCREF(__pyx_m);
24083 #if PY_MAJOR_VERSION < 3
24084 __pyx_m = Py_InitModule4(
"csmoothers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
24086 __pyx_m = PyModule_Create(&__pyx_moduledef);
24088 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
24090 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
24091 Py_INCREF(__pyx_d);
24092 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
24093 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
24094 #if CYTHON_COMPILING_IN_PYPY
24095 Py_INCREF(__pyx_b);
24097 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
24099 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24100 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
24101 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24103 if (__pyx_module_is_main_csmoothers) {
24104 if (PyObject_SetAttrString(__pyx_m,
"__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24106 #if PY_MAJOR_VERSION >= 3
24108 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
24109 if (!PyDict_GetItemString(modules,
"csmoothers")) {
24110 if (unlikely(PyDict_SetItemString(modules,
"csmoothers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
24115 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24117 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24119 (void)__Pyx_modinit_global_init_code();
24120 (void)__Pyx_modinit_variable_export_code();
24121 (void)__Pyx_modinit_function_export_code();
24122 if (unlikely(__Pyx_modinit_type_init_code() != 0))
goto __pyx_L1_error;
24123 if (unlikely(__Pyx_modinit_type_import_code() != 0))
goto __pyx_L1_error;
24124 (void)__Pyx_modinit_variable_import_code();
24125 (void)__Pyx_modinit_function_import_code();
24127 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
24128 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24136 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24137 __Pyx_GOTREF(__pyx_t_1);
24138 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24139 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24148 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__35);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
24149 __Pyx_GOTREF(__pyx_t_1);
24150 __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__35, __pyx_n_s_ASMFactor, __pyx_n_s_ASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
24151 __Pyx_GOTREF(__pyx_t_2);
24160 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10csmoothers_9ASMFactor_1__init__, 0, __pyx_n_s_ASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__37));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error)
24161 __Pyx_GOTREF(__pyx_t_3);
24162 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
24163 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24172 __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ASMFactor, __pyx_tuple__35, __pyx_t_2, NULL, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
24173 __Pyx_GOTREF(__pyx_t_3);
24174 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
24175 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24176 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24177 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24186 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__38);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
24187 __Pyx_GOTREF(__pyx_t_1);
24188 __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__38, __pyx_n_s_BASMFactor, __pyx_n_s_BASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
24189 __Pyx_GOTREF(__pyx_t_2);
24198 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10csmoothers_10BASMFactor_1__init__, 0, __pyx_n_s_BASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__40));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
24199 __Pyx_GOTREF(__pyx_t_3);
24200 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
24201 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24210 __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_BASMFactor, __pyx_tuple__38, __pyx_t_2, NULL, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
24211 __Pyx_GOTREF(__pyx_t_3);
24212 if (PyDict_SetItem(__pyx_d, __pyx_n_s_BASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
24213 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24214 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24215 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24224 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_1jacobi_NR_prepare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
24225 __Pyx_GOTREF(__pyx_t_1);
24226 if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
24227 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24236 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_3jacobi_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
24237 __Pyx_GOTREF(__pyx_t_1);
24238 if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
24239 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24248 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_5nl_jacobi_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
24249 __Pyx_GOTREF(__pyx_t_1);
24250 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
24251 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24260 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_7gauss_seidel_NR_preare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
24261 __Pyx_GOTREF(__pyx_t_1);
24262 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_preare, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
24263 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24272 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_9gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
24273 __Pyx_GOTREF(__pyx_t_1);
24274 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
24275 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24284 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
24285 __Pyx_GOTREF(__pyx_t_1);
24286 if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
24287 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24296 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_13asm_NR_prepare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
24297 __Pyx_GOTREF(__pyx_t_1);
24298 if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 251, __pyx_L1_error)
24299 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24308 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_15asm_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
24309 __Pyx_GOTREF(__pyx_t_1);
24310 if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
24311 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24320 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_17basm_NR_prepare, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
24321 __Pyx_GOTREF(__pyx_t_1);
24322 if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
24323 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24332 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_19basm_NR_solve, NULL, __pyx_n_s_csmoothers);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
24333 __Pyx_GOTREF(__pyx_t_1);
24334 if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
24335 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24342 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24343 __Pyx_GOTREF(__pyx_t_1);
24344 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24345 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24354 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 208, __pyx_L1_error)
24355 __Pyx_GOTREF(__pyx_t_1);
24356 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 208, __pyx_L1_error)
24357 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24358 PyType_Modified(__pyx_array_type);
24367 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__61, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 285, __pyx_L1_error)
24368 __Pyx_GOTREF(__pyx_t_1);
24369 __Pyx_XGOTREF(
generic);
24370 __Pyx_DECREF_SET(
generic, __pyx_t_1);
24371 __Pyx_GIVEREF(__pyx_t_1);
24381 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__62, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
24382 __Pyx_GOTREF(__pyx_t_1);
24383 __Pyx_XGOTREF(strided);
24384 __Pyx_DECREF_SET(strided, __pyx_t_1);
24385 __Pyx_GIVEREF(__pyx_t_1);
24395 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__63, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
24396 __Pyx_GOTREF(__pyx_t_1);
24397 __Pyx_XGOTREF(indirect);
24398 __Pyx_DECREF_SET(indirect, __pyx_t_1);
24399 __Pyx_GIVEREF(__pyx_t_1);
24409 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__64, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error)
24410 __Pyx_GOTREF(__pyx_t_1);
24411 __Pyx_XGOTREF(contiguous);
24412 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
24413 __Pyx_GIVEREF(__pyx_t_1);
24423 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__65, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
24424 __Pyx_GOTREF(__pyx_t_1);
24425 __Pyx_XGOTREF(indirect_contiguous);
24426 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
24427 __Pyx_GIVEREF(__pyx_t_1);
24437 __pyx_memoryview_thread_locks_used = 0;
24446 __pyx_t_4[0] = PyThread_allocate_lock();
24447 __pyx_t_4[1] = PyThread_allocate_lock();
24448 __pyx_t_4[2] = PyThread_allocate_lock();
24449 __pyx_t_4[3] = PyThread_allocate_lock();
24450 __pyx_t_4[4] = PyThread_allocate_lock();
24451 __pyx_t_4[5] = PyThread_allocate_lock();
24452 __pyx_t_4[6] = PyThread_allocate_lock();
24453 __pyx_t_4[7] = PyThread_allocate_lock();
24454 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
24463 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 544, __pyx_L1_error)
24464 __Pyx_GOTREF(__pyx_t_1);
24465 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 544, __pyx_L1_error)
24466 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24467 PyType_Modified(__pyx_memoryview_type);
24476 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 990, __pyx_L1_error)
24477 __Pyx_GOTREF(__pyx_t_1);
24478 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 990, __pyx_L1_error)
24479 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24480 PyType_Modified(__pyx_memoryviewslice_type);
24487 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24488 __Pyx_GOTREF(__pyx_t_1);
24489 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24490 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24504 __Pyx_XDECREF(__pyx_t_1);
24505 __Pyx_XDECREF(__pyx_t_2);
24506 __Pyx_XDECREF(__pyx_t_3);
24509 __Pyx_AddTraceback(
"init csmoothers", 0, __pyx_lineno, __pyx_filename);
24511 Py_DECREF(__pyx_m); __pyx_m = 0;
24512 }
else if (!PyErr_Occurred()) {
24513 PyErr_SetString(PyExc_ImportError,
"init csmoothers");
24516 __Pyx_RefNannyFinishContext();
24517 #if CYTHON_PEP489_MULTI_PHASE_INIT
24518 return (__pyx_m != NULL) ? 0 : -1;
24519 #elif PY_MAJOR_VERSION >= 3
24528 #if CYTHON_REFNANNY
24529 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
24530 PyObject *m = NULL, *p = NULL;
24532 m = PyImport_ImportModule((
char *)modname);
24534 p = PyObject_GetAttrString(m, (
char *)
"RefNannyAPI");
24536 r = PyLong_AsVoidPtr(p);
24540 return (__Pyx_RefNannyAPIStruct *)
r;
24545 #if CYTHON_USE_TYPE_SLOTS
24546 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24547 PyTypeObject* tp = Py_TYPE(obj);
24548 if (likely(tp->tp_getattro))
24549 return tp->tp_getattro(obj, attr_name);
24550 #if PY_MAJOR_VERSION < 3
24551 if (likely(tp->tp_getattr))
24552 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24554 return PyObject_GetAttr(obj, attr_name);
24559 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24560 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24561 if (unlikely(!result)) {
24562 PyErr_Format(PyExc_NameError,
24563 #
if PY_MAJOR_VERSION >= 3
24564 "name '%U' is not defined", name);
24566 "name '%.200s' is not defined", PyString_AS_STRING(name));
24573 static void __Pyx_RaiseArgtupleInvalid(
24574 const char* func_name,
24576 Py_ssize_t num_min,
24577 Py_ssize_t num_max,
24578 Py_ssize_t num_found)
24580 Py_ssize_t num_expected;
24581 const char *more_or_less;
24582 if (num_found < num_min) {
24583 num_expected = num_min;
24584 more_or_less =
"at least";
24586 num_expected = num_max;
24587 more_or_less =
"at most";
24590 more_or_less =
"exactly";
24592 PyErr_Format(PyExc_TypeError,
24593 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
24594 func_name, more_or_less, num_expected,
24595 (num_expected == 1) ?
"" :
"s", num_found);
24599 static void __Pyx_RaiseDoubleKeywordsError(
24600 const char* func_name,
24603 PyErr_Format(PyExc_TypeError,
24604 #
if PY_MAJOR_VERSION >= 3
24605 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24607 "%s() got multiple values for keyword argument '%s'", func_name,
24608 PyString_AsString(kw_name));
24613 static int __Pyx_ParseOptionalKeywords(
24615 PyObject **argnames[],
24617 PyObject *values[],
24618 Py_ssize_t num_pos_args,
24619 const char* function_name)
24621 PyObject *key = 0, *value = 0;
24622 Py_ssize_t
pos = 0;
24624 PyObject*** first_kw_arg = argnames + num_pos_args;
24625 while (PyDict_Next(kwds, &
pos, &key, &value)) {
24626 name = first_kw_arg;
24627 while (*name && (**name != key)) name++;
24629 values[name-argnames] = value;
24632 name = first_kw_arg;
24633 #if PY_MAJOR_VERSION < 3
24634 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
24636 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24637 && _PyString_Eq(**name, key)) {
24638 values[name-argnames] = value;
24643 if (*name)
continue;
24645 PyObject*** argname = argnames;
24646 while (argname != first_kw_arg) {
24647 if ((**argname == key) || (
24648 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24649 && _PyString_Eq(**argname, key))) {
24650 goto arg_passed_twice;
24657 if (likely(PyUnicode_Check(key))) {
24659 int cmp = (**name == key) ? 0 :
24660 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24661 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
24663 PyUnicode_Compare(**name, key);
24664 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24666 values[name-argnames] = value;
24671 if (*name)
continue;
24673 PyObject*** argname = argnames;
24674 while (argname != first_kw_arg) {
24675 int cmp = (**argname == key) ? 0 :
24676 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24677 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
24679 PyUnicode_Compare(**argname, key);
24680 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24681 if (cmp == 0)
goto arg_passed_twice;
24686 goto invalid_keyword_type;
24688 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
24690 goto invalid_keyword;
24695 __Pyx_RaiseDoubleKeywordsError(function_name, key);
24697 invalid_keyword_type:
24698 PyErr_Format(PyExc_TypeError,
24699 "%.200s() keywords must be strings", function_name);
24702 PyErr_Format(PyExc_TypeError,
24703 #
if PY_MAJOR_VERSION < 3
24704 "%.200s() got an unexpected keyword argument '%.200s'",
24705 function_name, PyString_AsString(key));
24707 "%s() got an unexpected keyword argument '%U'",
24708 function_name, key);
24715 #if CYTHON_USE_TYPE_SLOTS
24716 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
24717 PyTypeObject* tp = Py_TYPE(obj);
24718 if (likely(tp->tp_setattro))
24719 return tp->tp_setattro(obj, attr_name, value);
24720 #if PY_MAJOR_VERSION < 3
24721 if (likely(tp->tp_setattr))
24722 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
24724 return PyObject_SetAttr(obj, attr_name, value);
24729 #if CYTHON_FAST_PYCCALL
24730 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24731 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24732 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24733 PyObject *
self = PyCFunction_GET_SELF(func);
24734 int flags = PyCFunction_GET_FLAGS(func);
24735 assert(PyCFunction_Check(func));
24736 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
24737 assert(nargs >= 0);
24738 assert(nargs == 0 || args != NULL);
24742 assert(!PyErr_Occurred());
24743 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24744 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (
self, args, nargs, NULL);
24746 return (*((__Pyx_PyCFunctionFast)meth)) (
self, args, nargs);
24752 #if CYTHON_FAST_PYCALL
24753 #include "frameobject.h"
24754 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24755 PyObject *globals) {
24757 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24758 PyObject **fastlocals;
24761 assert(globals != NULL);
24766 assert(tstate != NULL);
24767 f = PyFrame_New(tstate, co, globals, NULL);
24771 fastlocals =
f->f_localsplus;
24772 for (i = 0; i < na; i++) {
24774 fastlocals[i] = *args++;
24776 result = PyEval_EvalFrameEx(
f,0);
24777 ++tstate->recursion_depth;
24779 --tstate->recursion_depth;
24782 #if 1 || PY_VERSION_HEX < 0x030600B1
24783 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
24784 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24785 PyObject *globals = PyFunction_GET_GLOBALS(func);
24786 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24788 #if PY_MAJOR_VERSION >= 3
24791 PyObject *kwtuple, **k;
24796 assert(kwargs == NULL || PyDict_Check(kwargs));
24797 nk = kwargs ? PyDict_Size(kwargs) : 0;
24798 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
24802 #
if PY_MAJOR_VERSION >= 3
24803 co->co_kwonlyargcount == 0 &&
24805 likely(kwargs == NULL || nk == 0) &&
24806 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24807 if (argdefs == NULL && co->co_argcount == nargs) {
24808 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24811 else if (nargs == 0 && argdefs != NULL
24812 && co->co_argcount == Py_SIZE(argdefs)) {
24815 args = &PyTuple_GET_ITEM(argdefs, 0);
24816 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24820 if (kwargs != NULL) {
24822 kwtuple = PyTuple_New(2 * nk);
24823 if (kwtuple == NULL) {
24827 k = &PyTuple_GET_ITEM(kwtuple, 0);
24829 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
24840 closure = PyFunction_GET_CLOSURE(func);
24841 #if PY_MAJOR_VERSION >= 3
24842 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24844 if (argdefs != NULL) {
24845 d = &PyTuple_GET_ITEM(argdefs, 0);
24846 nd = Py_SIZE(argdefs);
24852 #if PY_MAJOR_VERSION >= 3
24853 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24856 d, (
int)nd, kwdefs, closure);
24858 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24861 d, (
int)nd, closure);
24863 Py_XDECREF(kwtuple);
24865 Py_LeaveRecursiveCall();
24872 #if CYTHON_COMPILING_IN_CPYTHON
24873 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24875 ternaryfunc call = func->ob_type->tp_call;
24876 if (unlikely(!call))
24877 return PyObject_Call(func, arg, kw);
24878 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24880 result = (*call)(func, arg, kw);
24881 Py_LeaveRecursiveCall();
24882 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24885 "NULL result without error in PyObject_Call");
24892 #if CYTHON_COMPILING_IN_CPYTHON
24893 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24894 PyObject *
self, *result;
24896 cfunc = PyCFunction_GET_FUNCTION(func);
24897 self = PyCFunction_GET_SELF(func);
24898 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24900 result = cfunc(
self, arg);
24901 Py_LeaveRecursiveCall();
24902 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24905 "NULL result without error in PyObject_Call");
24912 #if CYTHON_COMPILING_IN_CPYTHON
24913 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24915 PyObject *args = PyTuple_New(1);
24916 if (unlikely(!args))
return NULL;
24918 PyTuple_SET_ITEM(args, 0, arg);
24919 result = __Pyx_PyObject_Call(func, args, NULL);
24923 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24924 #if CYTHON_FAST_PYCALL
24925 if (PyFunction_Check(func)) {
24926 return __Pyx_PyFunction_FastCall(func, &arg, 1);
24929 if (likely(PyCFunction_Check(func))) {
24930 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24931 return __Pyx_PyObject_CallMethO(func, arg);
24932 #if CYTHON_FAST_PYCCALL
24933 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24934 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24938 return __Pyx__PyObject_CallOneArg(func, arg);
24941 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24943 PyObject *args = PyTuple_Pack(1, arg);
24944 if (unlikely(!args))
return NULL;
24945 result = __Pyx_PyObject_Call(func, args, NULL);
24952 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
24954 if (unlikely(!type)) {
24955 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24959 #if PY_MAJOR_VERSION == 2
24960 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
24964 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
24966 PyErr_Format(PyExc_TypeError,
24967 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24968 name, type->tp_name, Py_TYPE(obj)->tp_name);
24973 #if CYTHON_FAST_THREAD_STATE
24974 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24975 PyObject *tmp_type, *tmp_value, *tmp_tb;
24976 tmp_type = tstate->curexc_type;
24977 tmp_value = tstate->curexc_value;
24978 tmp_tb = tstate->curexc_traceback;
24979 tstate->curexc_type = type;
24980 tstate->curexc_value = value;
24981 tstate->curexc_traceback = tb;
24982 Py_XDECREF(tmp_type);
24983 Py_XDECREF(tmp_value);
24984 Py_XDECREF(tmp_tb);
24986 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24987 *type = tstate->curexc_type;
24988 *value = tstate->curexc_value;
24989 *tb = tstate->curexc_traceback;
24990 tstate->curexc_type = 0;
24991 tstate->curexc_value = 0;
24992 tstate->curexc_traceback = 0;
24997 #if PY_MAJOR_VERSION < 3
24998 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24999 CYTHON_UNUSED PyObject *cause) {
25000 __Pyx_PyThreadState_declare
25002 if (!value || value == Py_None)
25006 if (!tb || tb == Py_None)
25010 if (!PyTraceBack_Check(tb)) {
25011 PyErr_SetString(PyExc_TypeError,
25012 "raise: arg 3 must be a traceback or None");
25016 if (PyType_Check(type)) {
25017 #if CYTHON_COMPILING_IN_PYPY
25019 Py_INCREF(Py_None);
25023 PyErr_NormalizeException(&type, &value, &tb);
25026 PyErr_SetString(PyExc_TypeError,
25027 "instance exception may not have a separate value");
25031 type = (PyObject*) Py_TYPE(type);
25033 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
25034 PyErr_SetString(PyExc_TypeError,
25035 "raise: exception class must be a subclass of BaseException");
25039 __Pyx_PyThreadState_assign
25040 __Pyx_ErrRestore(type, value, tb);
25049 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
25050 PyObject* owned_instance = NULL;
25051 if (tb == Py_None) {
25053 }
else if (tb && !PyTraceBack_Check(tb)) {
25054 PyErr_SetString(PyExc_TypeError,
25055 "raise: arg 3 must be a traceback or None");
25058 if (value == Py_None)
25060 if (PyExceptionInstance_Check(type)) {
25062 PyErr_SetString(PyExc_TypeError,
25063 "instance exception may not have a separate value");
25067 type = (PyObject*) Py_TYPE(value);
25068 }
else if (PyExceptionClass_Check(type)) {
25069 PyObject *instance_class = NULL;
25070 if (value && PyExceptionInstance_Check(value)) {
25071 instance_class = (PyObject*) Py_TYPE(value);
25072 if (instance_class != type) {
25073 int is_subclass = PyObject_IsSubclass(instance_class, type);
25074 if (!is_subclass) {
25075 instance_class = NULL;
25076 }
else if (unlikely(is_subclass == -1)) {
25079 type = instance_class;
25083 if (!instance_class) {
25086 args = PyTuple_New(0);
25087 else if (PyTuple_Check(value)) {
25091 args = PyTuple_Pack(1, value);
25094 owned_instance = PyObject_Call(type, args, NULL);
25096 if (!owned_instance)
25098 value = owned_instance;
25099 if (!PyExceptionInstance_Check(value)) {
25100 PyErr_Format(PyExc_TypeError,
25101 "calling %R should have returned an instance of "
25102 "BaseException, not %R",
25103 type, Py_TYPE(value));
25108 PyErr_SetString(PyExc_TypeError,
25109 "raise: exception class must be a subclass of BaseException");
25113 PyObject *fixed_cause;
25114 if (cause == Py_None) {
25115 fixed_cause = NULL;
25116 }
else if (PyExceptionClass_Check(cause)) {
25117 fixed_cause = PyObject_CallObject(cause, NULL);
25118 if (fixed_cause == NULL)
25120 }
else if (PyExceptionInstance_Check(cause)) {
25121 fixed_cause = cause;
25122 Py_INCREF(fixed_cause);
25124 PyErr_SetString(PyExc_TypeError,
25125 "exception causes must derive from "
25129 PyException_SetCause(value, fixed_cause);
25131 PyErr_SetObject(type, value);
25133 #if CYTHON_COMPILING_IN_PYPY
25134 PyObject *tmp_type, *tmp_value, *tmp_tb;
25135 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
25137 PyErr_Restore(tmp_type, tmp_value, tb);
25138 Py_XDECREF(tmp_tb);
25140 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25141 PyObject* tmp_tb = tstate->curexc_traceback;
25142 if (tb != tmp_tb) {
25144 tstate->curexc_traceback = tb;
25145 Py_XDECREF(tmp_tb);
25150 Py_XDECREF(owned_instance);
25156 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25157 if (unlikely(!type)) {
25158 PyErr_SetString(PyExc_SystemError,
"Missing type object");
25161 if (likely(__Pyx_TypeCheck(obj, type)))
25163 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
25164 Py_TYPE(obj)->tp_name, type->tp_name);
25170 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
25172 __Pyx_memviewslice *memviewslice,
25173 int memview_is_new_reference)
25175 __Pyx_RefNannyDeclarations
25177 Py_buffer *buf = &memview->view;
25178 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
25180 PyErr_SetString(PyExc_ValueError,
25183 }
else if (memviewslice->memview || memviewslice->data) {
25184 PyErr_SetString(PyExc_ValueError,
25185 "memviewslice is already initialized!");
25188 if (buf->strides) {
25189 for (i = 0; i < ndim; i++) {
25190 memviewslice->strides[i] = buf->strides[i];
25193 Py_ssize_t stride = buf->itemsize;
25194 for (i = ndim - 1; i >= 0; i--) {
25195 memviewslice->strides[i] = stride;
25196 stride *= buf->shape[i];
25199 for (i = 0; i < ndim; i++) {
25200 memviewslice->shape[i] = buf->shape[i];
25201 if (buf->suboffsets) {
25202 memviewslice->suboffsets[i] = buf->suboffsets[i];
25204 memviewslice->suboffsets[i] = -1;
25207 memviewslice->memview = memview;
25208 memviewslice->data = (
char *)buf->buf;
25209 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
25210 Py_INCREF(memview);
25215 memviewslice->memview = 0;
25216 memviewslice->data = 0;
25219 __Pyx_RefNannyFinishContext();
25222 #ifndef Py_NO_RETURN
25223 #define Py_NO_RETURN
25225 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
25228 #ifdef HAVE_STDARG_PROTOTYPES
25229 va_start(vargs, fmt);
25233 vsnprintf(msg, 200, fmt, vargs);
25235 Py_FatalError(msg);
25237 static CYTHON_INLINE
int
25238 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
25239 PyThread_type_lock lock)
25242 PyThread_acquire_lock(lock, 1);
25243 result = (*acquisition_count)++;
25244 PyThread_release_lock(lock);
25247 static CYTHON_INLINE
int
25248 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
25249 PyThread_type_lock lock)
25252 PyThread_acquire_lock(lock, 1);
25253 result = (*acquisition_count)--;
25254 PyThread_release_lock(lock);
25257 static CYTHON_INLINE
void
25258 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
25261 struct __pyx_memoryview_obj *memview = memslice->memview;
25262 if (!memview || (PyObject *) memview == Py_None)
25264 if (__pyx_get_slice_count(memview) < 0)
25265 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
25266 __pyx_get_slice_count(memview), lineno);
25267 first_time = __pyx_add_acquisition_count(memview) == 0;
25270 Py_INCREF((PyObject *) memview);
25272 PyGILState_STATE _gilstate = PyGILState_Ensure();
25273 Py_INCREF((PyObject *) memview);
25274 PyGILState_Release(_gilstate);
25278 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
25279 int have_gil,
int lineno) {
25281 struct __pyx_memoryview_obj *memview = memslice->memview;
25284 }
else if ((PyObject *) memview == Py_None) {
25285 memslice->memview = NULL;
25288 if (__pyx_get_slice_count(memview) <= 0)
25289 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
25290 __pyx_get_slice_count(memview), lineno);
25291 last_time = __pyx_sub_acquisition_count(memview) == 1;
25292 memslice->data = NULL;
25295 Py_CLEAR(memslice->memview);
25297 PyGILState_STATE _gilstate = PyGILState_Ensure();
25298 Py_CLEAR(memslice->memview);
25299 PyGILState_Release(_gilstate);
25302 memslice->memview = NULL;
25307 static void __Pyx_RaiseBufferIndexError(
int axis) {
25308 PyErr_Format(PyExc_IndexError,
25309 "Out of bounds on buffer access (axis %d)", axis);
25313 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
25314 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
25315 int full_traceback, CYTHON_UNUSED
int nogil) {
25316 PyObject *old_exc, *old_val, *old_tb;
25318 __Pyx_PyThreadState_declare
25320 PyGILState_STATE state;
25322 state = PyGILState_Ensure();
25324 else state = (PyGILState_STATE)-1;
25327 __Pyx_PyThreadState_assign
25328 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
25329 if (full_traceback) {
25330 Py_XINCREF(old_exc);
25331 Py_XINCREF(old_val);
25332 Py_XINCREF(old_tb);
25333 __Pyx_ErrRestore(old_exc, old_val, old_tb);
25336 #if PY_MAJOR_VERSION < 3
25337 ctx = PyString_FromString(name);
25339 ctx = PyUnicode_FromString(name);
25341 __Pyx_ErrRestore(old_exc, old_val, old_tb);
25343 PyErr_WriteUnraisable(Py_None);
25345 PyErr_WriteUnraisable(ctx);
25350 PyGILState_Release(state);
25355 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
25356 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
25358 value = PyDict_GetItemWithError(d, key);
25359 if (unlikely(!value)) {
25360 if (!PyErr_Occurred()) {
25361 PyObject* args = PyTuple_Pack(1, key);
25363 PyErr_SetObject(PyExc_KeyError, args);
25374 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25375 PyErr_Format(PyExc_ValueError,
25376 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
25380 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25381 PyErr_Format(PyExc_ValueError,
25382 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
25383 index, (index == 1) ?
"" :
"s");
25387 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
25388 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
25392 #if CYTHON_FAST_THREAD_STATE
25393 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25394 #if PY_VERSION_HEX >= 0x030700A3
25395 *type = tstate->exc_state.exc_type;
25396 *value = tstate->exc_state.exc_value;
25397 *tb = tstate->exc_state.exc_traceback;
25399 *type = tstate->exc_type;
25400 *value = tstate->exc_value;
25401 *tb = tstate->exc_traceback;
25404 Py_XINCREF(*value);
25407 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25408 PyObject *tmp_type, *tmp_value, *tmp_tb;
25409 #if PY_VERSION_HEX >= 0x030700A3
25410 tmp_type = tstate->exc_state.exc_type;
25411 tmp_value = tstate->exc_state.exc_value;
25412 tmp_tb = tstate->exc_state.exc_traceback;
25413 tstate->exc_state.exc_type = type;
25414 tstate->exc_state.exc_value = value;
25415 tstate->exc_state.exc_traceback = tb;
25417 tmp_type = tstate->exc_type;
25418 tmp_value = tstate->exc_value;
25419 tmp_tb = tstate->exc_traceback;
25420 tstate->exc_type = type;
25421 tstate->exc_value = value;
25422 tstate->exc_traceback = tb;
25424 Py_XDECREF(tmp_type);
25425 Py_XDECREF(tmp_value);
25426 Py_XDECREF(tmp_tb);
25431 #if CYTHON_FAST_THREAD_STATE
25432 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25434 n = PyTuple_GET_SIZE(tuple);
25435 #if PY_MAJOR_VERSION >= 3
25436 for (i=0; i<
n; i++) {
25437 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
25440 for (i=0; i<
n; i++) {
25441 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
25445 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25446 PyObject *exc_type = tstate->curexc_type;
25447 if (exc_type == err)
return 1;
25448 if (unlikely(!exc_type))
return 0;
25449 if (unlikely(PyTuple_Check(err)))
25450 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25451 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25456 #if CYTHON_FAST_THREAD_STATE
25457 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25459 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
25461 PyObject *local_type, *local_value, *local_tb;
25462 #if CYTHON_FAST_THREAD_STATE
25463 PyObject *tmp_type, *tmp_value, *tmp_tb;
25464 local_type = tstate->curexc_type;
25465 local_value = tstate->curexc_value;
25466 local_tb = tstate->curexc_traceback;
25467 tstate->curexc_type = 0;
25468 tstate->curexc_value = 0;
25469 tstate->curexc_traceback = 0;
25471 PyErr_Fetch(&local_type, &local_value, &local_tb);
25473 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25474 #if CYTHON_FAST_THREAD_STATE
25475 if (unlikely(tstate->curexc_type))
25477 if (unlikely(PyErr_Occurred()))
25480 #if PY_MAJOR_VERSION >= 3
25482 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25486 Py_XINCREF(local_tb);
25487 Py_XINCREF(local_type);
25488 Py_XINCREF(local_value);
25489 *type = local_type;
25490 *value = local_value;
25492 #if CYTHON_FAST_THREAD_STATE
25493 #if PY_VERSION_HEX >= 0x030700A3
25494 tmp_type = tstate->exc_state.exc_type;
25495 tmp_value = tstate->exc_state.exc_value;
25496 tmp_tb = tstate->exc_state.exc_traceback;
25497 tstate->exc_state.exc_type = local_type;
25498 tstate->exc_state.exc_value = local_value;
25499 tstate->exc_state.exc_traceback = local_tb;
25501 tmp_type = tstate->exc_type;
25502 tmp_value = tstate->exc_value;
25503 tmp_tb = tstate->exc_traceback;
25504 tstate->exc_type = local_type;
25505 tstate->exc_value = local_value;
25506 tstate->exc_traceback = local_tb;
25508 Py_XDECREF(tmp_type);
25509 Py_XDECREF(tmp_value);
25510 Py_XDECREF(tmp_tb);
25512 PyErr_SetExcInfo(local_type, local_value, local_tb);
25519 Py_XDECREF(local_type);
25520 Py_XDECREF(local_value);
25521 Py_XDECREF(local_tb);
25526 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
25527 #if CYTHON_COMPILING_IN_PYPY
25528 return PyObject_RichCompareBool(s1, s2, equals);
25531 return (equals == Py_EQ);
25532 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
25533 const char *ps1, *ps2;
25534 Py_ssize_t length = PyBytes_GET_SIZE(s1);
25535 if (length != PyBytes_GET_SIZE(s2))
25536 return (equals == Py_NE);
25537 ps1 = PyBytes_AS_STRING(s1);
25538 ps2 = PyBytes_AS_STRING(s2);
25539 if (ps1[0] != ps2[0]) {
25540 return (equals == Py_NE);
25541 }
else if (length == 1) {
25542 return (equals == Py_EQ);
25545 #if CYTHON_USE_UNICODE_INTERNALS
25546 Py_hash_t hash1, hash2;
25547 hash1 = ((PyBytesObject*)s1)->ob_shash;
25548 hash2 = ((PyBytesObject*)s2)->ob_shash;
25549 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25550 return (equals == Py_NE);
25553 result = memcmp(ps1, ps2, (
size_t)length);
25554 return (equals == Py_EQ) ? (result == 0) : (result != 0);
25556 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
25557 return (equals == Py_NE);
25558 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
25559 return (equals == Py_NE);
25562 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25565 result = __Pyx_PyObject_IsTrue(py_result);
25566 Py_DECREF(py_result);
25573 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
25574 #if CYTHON_COMPILING_IN_PYPY
25575 return PyObject_RichCompareBool(s1, s2, equals);
25577 #if PY_MAJOR_VERSION < 3
25578 PyObject* owned_ref = NULL;
25580 int s1_is_unicode, s2_is_unicode;
25584 s1_is_unicode = PyUnicode_CheckExact(s1);
25585 s2_is_unicode = PyUnicode_CheckExact(s2);
25586 #if PY_MAJOR_VERSION < 3
25587 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25588 owned_ref = PyUnicode_FromObject(s2);
25589 if (unlikely(!owned_ref))
25593 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25594 owned_ref = PyUnicode_FromObject(s1);
25595 if (unlikely(!owned_ref))
25599 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25600 return __Pyx_PyBytes_Equals(s1, s2, equals);
25603 if (s1_is_unicode & s2_is_unicode) {
25606 void *data1, *data2;
25607 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25609 length = __Pyx_PyUnicode_GET_LENGTH(s1);
25610 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25613 #if CYTHON_USE_UNICODE_INTERNALS
25615 Py_hash_t hash1, hash2;
25616 #if CYTHON_PEP393_ENABLED
25617 hash1 = ((PyASCIIObject*)s1)->hash;
25618 hash2 = ((PyASCIIObject*)s2)->hash;
25620 hash1 = ((PyUnicodeObject*)s1)->hash;
25621 hash2 = ((PyUnicodeObject*)s2)->hash;
25623 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25628 kind = __Pyx_PyUnicode_KIND(s1);
25629 if (kind != __Pyx_PyUnicode_KIND(s2)) {
25632 data1 = __Pyx_PyUnicode_DATA(s1);
25633 data2 = __Pyx_PyUnicode_DATA(s2);
25634 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25636 }
else if (length == 1) {
25639 int result = memcmp(data1, data2, (
size_t)(length * kind));
25640 #if PY_MAJOR_VERSION < 3
25641 Py_XDECREF(owned_ref);
25643 return (equals == Py_EQ) ? (result == 0) : (result != 0);
25645 }
else if ((s1 == Py_None) & s2_is_unicode) {
25647 }
else if ((s2 == Py_None) & s1_is_unicode) {
25651 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25652 #if PY_MAJOR_VERSION < 3
25653 Py_XDECREF(owned_ref);
25657 result = __Pyx_PyObject_IsTrue(py_result);
25658 Py_DECREF(py_result);
25662 #if PY_MAJOR_VERSION < 3
25663 Py_XDECREF(owned_ref);
25665 return (equals == Py_EQ);
25667 #if PY_MAJOR_VERSION < 3
25668 Py_XDECREF(owned_ref);
25670 return (equals == Py_NE);
25675 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
25676 Py_ssize_t
q = a / b;
25677 Py_ssize_t
r = a -
q*b;
25678 q -= ((
r != 0) & ((
r ^ b) < 0));
25683 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
25684 #if CYTHON_USE_TYPE_SLOTS
25685 #if PY_MAJOR_VERSION >= 3
25686 if (likely(PyUnicode_Check(
n)))
25688 if (likely(PyString_Check(
n)))
25690 return __Pyx_PyObject_GetAttrStr(o,
n);
25692 return PyObject_GetAttr(o,
n);
25696 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
25698 if (!j)
return NULL;
25699 r = PyObject_GetItem(o, j);
25703 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
25704 CYTHON_NCP_UNUSED
int wraparound,
25705 CYTHON_NCP_UNUSED
int boundscheck) {
25706 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25707 Py_ssize_t wrapped_i = i;
25708 if (wraparound & unlikely(i < 0)) {
25709 wrapped_i += PyList_GET_SIZE(o);
25711 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
25712 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
25716 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25718 return PySequence_GetItem(o, i);
25721 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
25722 CYTHON_NCP_UNUSED
int wraparound,
25723 CYTHON_NCP_UNUSED
int boundscheck) {
25724 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25725 Py_ssize_t wrapped_i = i;
25726 if (wraparound & unlikely(i < 0)) {
25727 wrapped_i += PyTuple_GET_SIZE(o);
25729 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
25730 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
25734 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25736 return PySequence_GetItem(o, i);
25739 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
25740 CYTHON_NCP_UNUSED
int wraparound,
25741 CYTHON_NCP_UNUSED
int boundscheck) {
25742 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
25743 if (is_list || PyList_CheckExact(o)) {
25744 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
25745 if ((!boundscheck) || (likely((
n >= 0) & (
n < PyList_GET_SIZE(o))))) {
25746 PyObject *
r = PyList_GET_ITEM(o,
n);
25751 else if (PyTuple_CheckExact(o)) {
25752 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
25753 if ((!boundscheck) || likely((
n >= 0) & (
n < PyTuple_GET_SIZE(o)))) {
25754 PyObject *
r = PyTuple_GET_ITEM(o,
n);
25759 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
25760 if (likely(m && m->sq_item)) {
25761 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
25762 Py_ssize_t l = m->sq_length(o);
25763 if (likely(l >= 0)) {
25766 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25771 return m->sq_item(o, i);
25775 if (is_list || PySequence_Check(o)) {
25776 return PySequence_GetItem(o, i);
25779 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25783 #if CYTHON_USE_TYPE_SLOTS
25784 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25786 Py_ssize_t key_value;
25787 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25788 if (unlikely(!(m && m->sq_item))) {
25789 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25792 key_value = __Pyx_PyIndex_AsSsize_t(index);
25793 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25794 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25796 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25798 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25802 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25803 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25804 if (likely(m && m->mp_subscript)) {
25805 return m->mp_subscript(obj, key);
25807 return __Pyx_PyObject_GetIndex(obj, key);
25812 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25813 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25814 const char* encoding,
const char* errors,
25815 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors)) {
25817 if (unlikely((start < 0) | (stop < 0))) {
25818 size_t slen = strlen(cstring);
25819 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
25820 PyErr_SetString(PyExc_OverflowError,
25821 "c-string too long to convert to Python");
25824 length = (Py_ssize_t) slen;
25833 length = stop - start;
25834 if (unlikely(length <= 0))
25835 return PyUnicode_FromUnicode(NULL, 0);
25838 return decode_func(cstring, length, errors);
25840 return PyUnicode_Decode(cstring, length, encoding, errors);
25845 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25846 __Pyx_PyThreadState_declare
25847 __Pyx_PyThreadState_assign
25848 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25850 __Pyx_PyErr_Clear();
25854 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
25855 PyObject *
r = __Pyx_GetAttr(o,
n);
25856 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
25860 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
25862 #if !CYTHON_AVOID_BORROWED_REFS
25863 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
25864 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25865 if (likely(result)) {
25867 }
else if (unlikely(PyErr_Occurred())) {
25871 result = PyDict_GetItem(__pyx_d, name);
25872 if (likely(result)) {
25877 result = PyObject_GetItem(__pyx_d, name);
25881 result = __Pyx_GetBuiltinName(name);
25887 #if CYTHON_FAST_THREAD_STATE
25888 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25889 PyObject *tmp_type, *tmp_value, *tmp_tb;
25890 #if PY_VERSION_HEX >= 0x030700A3
25891 tmp_type = tstate->exc_state.exc_type;
25892 tmp_value = tstate->exc_state.exc_value;
25893 tmp_tb = tstate->exc_state.exc_traceback;
25894 tstate->exc_state.exc_type = *type;
25895 tstate->exc_state.exc_value = *value;
25896 tstate->exc_state.exc_traceback = *tb;
25898 tmp_type = tstate->exc_type;
25899 tmp_value = tstate->exc_value;
25900 tmp_tb = tstate->exc_traceback;
25901 tstate->exc_type = *type;
25902 tstate->exc_value = *value;
25903 tstate->exc_traceback = *tb;
25906 *value = tmp_value;
25910 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25911 PyObject *tmp_type, *tmp_value, *tmp_tb;
25912 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25913 PyErr_SetExcInfo(*type, *value, *tb);
25915 *value = tmp_value;
25921 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
25922 PyObject *empty_list = 0;
25923 PyObject *module = 0;
25924 PyObject *global_dict = 0;
25925 PyObject *empty_dict = 0;
25927 #if PY_MAJOR_VERSION < 3
25928 PyObject *py_import;
25929 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25936 empty_list = PyList_New(0);
25941 global_dict = PyModule_GetDict(__pyx_m);
25944 empty_dict = PyDict_New();
25948 #if PY_MAJOR_VERSION >= 3
25950 if (strchr(__Pyx_MODULE_NAME,
'.')) {
25951 module = PyImport_ImportModuleLevelObject(
25952 name, global_dict, empty_dict, list, 1);
25954 if (!PyErr_ExceptionMatches(PyExc_ImportError))
25963 #if PY_MAJOR_VERSION < 3
25964 PyObject *py_level = PyInt_FromLong(level);
25967 module = PyObject_CallFunctionObjArgs(py_import,
25968 name, global_dict, empty_dict, list, py_level, NULL);
25969 Py_DECREF(py_level);
25971 module = PyImport_ImportModuleLevelObject(
25972 name, global_dict, empty_dict, list, level);
25977 #if PY_MAJOR_VERSION < 3
25978 Py_XDECREF(py_import);
25980 Py_XDECREF(empty_list);
25981 Py_XDECREF(empty_dict);
25986 #if CYTHON_COMPILING_IN_CPYTHON
25987 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25993 return b == &PyBaseObject_Type;
25995 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25997 if (a == b)
return 1;
26001 n = PyTuple_GET_SIZE(mro);
26002 for (i = 0; i <
n; i++) {
26003 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26008 return __Pyx_InBases(a, b);
26010 #if PY_MAJOR_VERSION == 2
26011 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
26012 PyObject *exception, *value, *tb;
26014 __Pyx_PyThreadState_declare
26015 __Pyx_PyThreadState_assign
26016 __Pyx_ErrFetch(&exception, &value, &tb);
26017 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
26018 if (unlikely(res == -1)) {
26019 PyErr_WriteUnraisable(err);
26023 res = PyObject_IsSubclass(err, exc_type2);
26024 if (unlikely(res == -1)) {
26025 PyErr_WriteUnraisable(err);
26029 __Pyx_ErrRestore(exception, value, tb);
26033 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
26034 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
26036 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
26041 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26043 assert(PyExceptionClass_Check(exc_type));
26044 n = PyTuple_GET_SIZE(tuple);
26045 #if PY_MAJOR_VERSION >= 3
26046 for (i=0; i<
n; i++) {
26047 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
26050 for (i=0; i<
n; i++) {
26051 PyObject *t = PyTuple_GET_ITEM(tuple, i);
26052 #if PY_MAJOR_VERSION < 3
26053 if (likely(exc_type == t))
return 1;
26055 if (likely(PyExceptionClass_Check(t))) {
26056 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
26062 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
26063 if (likely(err == exc_type))
return 1;
26064 if (likely(PyExceptionClass_Check(err))) {
26065 if (likely(PyExceptionClass_Check(exc_type))) {
26066 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
26067 }
else if (likely(PyTuple_Check(exc_type))) {
26068 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
26072 return PyErr_GivenExceptionMatches(err, exc_type);
26074 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
26075 assert(PyExceptionClass_Check(exc_type1));
26076 assert(PyExceptionClass_Check(exc_type2));
26077 if (likely(err == exc_type1 || err == exc_type2))
return 1;
26078 if (likely(PyExceptionClass_Check(err))) {
26079 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
26081 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
26086 #if !CYTHON_COMPILING_IN_PYPY
26087 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
int inplace) {
26088 #if PY_MAJOR_VERSION < 3
26089 if (likely(PyInt_CheckExact(op1))) {
26090 const long b = intval;
26092 long a = PyInt_AS_LONG(op1);
26093 x = (long)((
unsigned long)a + b);
26094 if (likely((x^a) >= 0 || (x^b) >= 0))
26095 return PyInt_FromLong(x);
26096 return PyLong_Type.tp_as_number->nb_add(op1, op2);
26099 #if CYTHON_USE_PYLONG_INTERNALS
26100 if (likely(PyLong_CheckExact(op1))) {
26101 const long b = intval;
26103 #ifdef HAVE_LONG_LONG
26104 const PY_LONG_LONG llb = intval;
26105 PY_LONG_LONG lla, llx;
26107 const digit* digits = ((PyLongObject*)op1)->ob_digit;
26108 const Py_ssize_t size = Py_SIZE(op1);
26109 if (likely(__Pyx_sst_abs(size) <= 1)) {
26110 a = likely(size) ? digits[0] : 0;
26111 if (size == -1) a = -a;
26115 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26116 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26118 #ifdef HAVE_LONG_LONG
26119 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26120 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26124 CYTHON_FALLTHROUGH;
26126 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26127 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26129 #ifdef HAVE_LONG_LONG
26130 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26131 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26135 CYTHON_FALLTHROUGH;
26137 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26138 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26140 #ifdef HAVE_LONG_LONG
26141 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26142 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26146 CYTHON_FALLTHROUGH;
26148 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26149 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26151 #ifdef HAVE_LONG_LONG
26152 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26153 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26157 CYTHON_FALLTHROUGH;
26159 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26160 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26162 #ifdef HAVE_LONG_LONG
26163 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26164 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26168 CYTHON_FALLTHROUGH;
26170 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26171 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26173 #ifdef HAVE_LONG_LONG
26174 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26175 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26179 CYTHON_FALLTHROUGH;
26180 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
26184 return PyLong_FromLong(x);
26185 #ifdef HAVE_LONG_LONG
26188 return PyLong_FromLongLong(llx);
26194 if (PyFloat_CheckExact(op1)) {
26195 const long b = intval;
26196 double a = PyFloat_AS_DOUBLE(op1);
26198 PyFPE_START_PROTECT(
"add",
return NULL)
26199 result = ((double)a) + (double)b;
26200 PyFPE_END_PROTECT(result)
26201 return PyFloat_FromDouble(result);
26203 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
26208 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
26209 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
26213 static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b) {
26216 q -= ((
r != 0) & ((
r ^ b) < 0));
26221 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
26222 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
26223 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
26224 PyErr_Format(PyExc_ImportError,
26225 #
if PY_MAJOR_VERSION < 3
26226 "cannot import name %.230s", PyString_AS_STRING(name));
26228 "cannot import name %S", name);
26235 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
26237 if (unlikely(!__Pyx_PyBaseString_Check(
n))) {
26238 PyErr_SetString(PyExc_TypeError,
26239 "hasattr(): attribute name must be string");
26242 r = __Pyx_GetAttr(o,
n);
26243 if (unlikely(!
r)) {
26253 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26254 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
26255 PyErr_Format(PyExc_AttributeError,
26256 #
if PY_MAJOR_VERSION >= 3
26257 "'%.50s' object has no attribute '%U'",
26258 tp->tp_name, attr_name);
26260 "'%.50s' object has no attribute '%.400s'",
26261 tp->tp_name, PyString_AS_STRING(attr_name));
26265 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
26267 PyTypeObject *tp = Py_TYPE(obj);
26268 if (unlikely(!PyString_Check(attr_name))) {
26269 return PyObject_GenericGetAttr(obj, attr_name);
26271 assert(!tp->tp_dictoffset);
26272 descr = _PyType_Lookup(tp, attr_name);
26273 if (unlikely(!descr)) {
26274 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
26277 #if PY_MAJOR_VERSION < 3
26278 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
26281 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
26283 PyObject *res =
f(descr, obj, (PyObject *)tp);
26293 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26294 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
26295 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
26296 return PyObject_GenericGetAttr(obj, attr_name);
26298 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
26303 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
26305 PyObject *name_attr;
26306 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
26307 if (likely(name_attr)) {
26308 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
26312 if (unlikely(ret < 0)) {
26316 Py_XDECREF(name_attr);
26319 static int __Pyx_setup_reduce(PyObject* type_obj) {
26321 PyObject *object_reduce = NULL;
26322 PyObject *object_reduce_ex = NULL;
26323 PyObject *reduce = NULL;
26324 PyObject *reduce_ex = NULL;
26325 PyObject *reduce_cython = NULL;
26326 PyObject *setstate = NULL;
26327 PyObject *setstate_cython = NULL;
26328 #if CYTHON_USE_PYTYPE_LOOKUP
26329 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto GOOD;
26331 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto GOOD;
26333 #if CYTHON_USE_PYTYPE_LOOKUP
26334 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
26336 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
26338 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto BAD;
26339 if (reduce_ex == object_reduce_ex) {
26340 #if CYTHON_USE_PYTYPE_LOOKUP
26341 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
26343 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
26345 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto BAD;
26346 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
26347 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto BAD;
26348 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto BAD;
26349 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto BAD;
26350 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
26351 if (!setstate) PyErr_Clear();
26352 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
26353 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto BAD;
26354 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto BAD;
26355 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto BAD;
26357 PyType_Modified((PyTypeObject*)type_obj);
26362 if (!PyErr_Occurred())
26363 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26366 #if !CYTHON_USE_PYTYPE_LOOKUP
26367 Py_XDECREF(object_reduce);
26368 Py_XDECREF(object_reduce_ex);
26370 Py_XDECREF(reduce);
26371 Py_XDECREF(reduce_ex);
26372 Py_XDECREF(reduce_cython);
26373 Py_XDECREF(setstate);
26374 Py_XDECREF(setstate_cython);
26379 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
26380 #if PY_VERSION_HEX >= 0x02070000
26381 PyObject *ob = PyCapsule_New(vtable, 0, 0);
26383 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26387 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
26397 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
26398 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
26399 for (i=0; i < nbases; i++) {
26400 PyTypeObject *tmptype;
26401 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
26402 tmptype = Py_TYPE(tmp);
26403 #if PY_MAJOR_VERSION < 3
26404 if (tmptype == &PyClass_Type)
26408 metaclass = tmptype;
26411 if (PyType_IsSubtype(metaclass, tmptype))
26413 if (PyType_IsSubtype(tmptype, metaclass)) {
26414 metaclass = tmptype;
26417 PyErr_SetString(PyExc_TypeError,
26418 "metaclass conflict: "
26419 "the metaclass of a derived class "
26420 "must be a (non-strict) subclass "
26421 "of the metaclasses of all its bases");
26425 #if PY_MAJOR_VERSION < 3
26426 metaclass = &PyClass_Type;
26428 metaclass = &PyType_Type;
26431 Py_INCREF((PyObject*) metaclass);
26432 return (PyObject*) metaclass;
26436 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
26437 PyObject* fake_module;
26438 PyTypeObject* cached_type = NULL;
26439 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
26440 if (!fake_module)
return NULL;
26441 Py_INCREF(fake_module);
26442 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
26444 if (!PyType_Check((PyObject*)cached_type)) {
26445 PyErr_Format(PyExc_TypeError,
26446 "Shared Cython type %.200s is not a type object",
26450 if (cached_type->tp_basicsize != type->tp_basicsize) {
26451 PyErr_Format(PyExc_TypeError,
26452 "Shared Cython type %.200s has the wrong size, try recompiling",
26457 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
26459 if (PyType_Ready(type) < 0)
goto bad;
26460 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
26463 cached_type = type;
26466 Py_DECREF(fake_module);
26467 return cached_type;
26469 Py_XDECREF(cached_type);
26470 cached_type = NULL;
26475 #include <structmember.h>
26477 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
26479 if (unlikely(op->func_doc == NULL)) {
26480 if (op->func.m_ml->ml_doc) {
26481 #if PY_MAJOR_VERSION >= 3
26482 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
26484 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
26486 if (unlikely(op->func_doc == NULL))
26489 Py_INCREF(Py_None);
26493 Py_INCREF(op->func_doc);
26494 return op->func_doc;
26497 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
26499 PyObject *tmp = op->func_doc;
26500 if (value == NULL) {
26504 op->func_doc = value;
26509 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
26511 if (unlikely(op->func_name == NULL)) {
26512 #if PY_MAJOR_VERSION >= 3
26513 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
26515 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
26517 if (unlikely(op->func_name == NULL))
26520 Py_INCREF(op->func_name);
26521 return op->func_name;
26524 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
26527 #if PY_MAJOR_VERSION >= 3
26528 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
26530 if (unlikely(value == NULL || !PyString_Check(value))) {
26532 PyErr_SetString(PyExc_TypeError,
26533 "__name__ must be set to a string object");
26536 tmp = op->func_name;
26538 op->func_name = value;
26543 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
26545 Py_INCREF(op->func_qualname);
26546 return op->func_qualname;
26549 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
26552 #if PY_MAJOR_VERSION >= 3
26553 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
26555 if (unlikely(value == NULL || !PyString_Check(value))) {
26557 PyErr_SetString(PyExc_TypeError,
26558 "__qualname__ must be set to a string object");
26561 tmp = op->func_qualname;
26563 op->func_qualname = value;
26568 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
26571 self = m->func_closure;
26578 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
26580 if (unlikely(op->func_dict == NULL)) {
26581 op->func_dict = PyDict_New();
26582 if (unlikely(op->func_dict == NULL))
26585 Py_INCREF(op->func_dict);
26586 return op->func_dict;
26589 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
26592 if (unlikely(value == NULL)) {
26593 PyErr_SetString(PyExc_TypeError,
26594 "function's dictionary may not be deleted");
26597 if (unlikely(!PyDict_Check(value))) {
26598 PyErr_SetString(PyExc_TypeError,
26599 "setting function's dictionary to a non-dict");
26602 tmp = op->func_dict;
26604 op->func_dict = value;
26609 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
26611 Py_INCREF(op->func_globals);
26612 return op->func_globals;
26615 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
26617 Py_INCREF(Py_None);
26621 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
26623 PyObject* result = (op->func_code) ? op->func_code : Py_None;
26628 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
26630 PyObject *res = op->defaults_getter((PyObject *) op);
26631 if (unlikely(!res))
26633 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26634 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
26635 Py_INCREF(op->defaults_tuple);
26636 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
26637 Py_INCREF(op->defaults_kwdict);
26639 op->defaults_tuple = PySequence_ITEM(res, 0);
26640 if (unlikely(!op->defaults_tuple)) result = -1;
26642 op->defaults_kwdict = PySequence_ITEM(res, 1);
26643 if (unlikely(!op->defaults_kwdict)) result = -1;
26650 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
26654 }
else if (value != Py_None && !PyTuple_Check(value)) {
26655 PyErr_SetString(PyExc_TypeError,
26656 "__defaults__ must be set to a tuple object");
26660 tmp = op->defaults_tuple;
26661 op->defaults_tuple = value;
26666 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
26667 PyObject* result = op->defaults_tuple;
26668 if (unlikely(!result)) {
26669 if (op->defaults_getter) {
26670 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
26671 result = op->defaults_tuple;
26680 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
26684 }
else if (value != Py_None && !PyDict_Check(value)) {
26685 PyErr_SetString(PyExc_TypeError,
26686 "__kwdefaults__ must be set to a dict object");
26690 tmp = op->defaults_kwdict;
26691 op->defaults_kwdict = value;
26696 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
26697 PyObject* result = op->defaults_kwdict;
26698 if (unlikely(!result)) {
26699 if (op->defaults_getter) {
26700 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
26701 result = op->defaults_kwdict;
26710 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
26712 if (!value || value == Py_None) {
26714 }
else if (!PyDict_Check(value)) {
26715 PyErr_SetString(PyExc_TypeError,
26716 "__annotations__ must be set to a dict object");
26720 tmp = op->func_annotations;
26721 op->func_annotations = value;
26726 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
26727 PyObject* result = op->func_annotations;
26728 if (unlikely(!result)) {
26729 result = PyDict_New();
26730 if (unlikely(!result))
return NULL;
26731 op->func_annotations = result;
26736 static PyGetSetDef __pyx_CyFunction_getsets[] = {
26737 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26738 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26739 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26740 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26741 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
26742 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
26743 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26744 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26745 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26746 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26747 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26748 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26749 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26750 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26751 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26752 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26753 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
26754 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
26757 static PyMemberDef __pyx_CyFunction_members[] = {
26758 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
26762 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
26764 #if PY_MAJOR_VERSION >= 3
26765 return PyUnicode_FromString(m->func.m_ml->ml_name);
26767 return PyString_FromString(m->func.m_ml->ml_name);
26770 static PyMethodDef __pyx_CyFunction_methods[] = {
26771 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26774 #if PY_VERSION_HEX < 0x030500A0
26775 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26777 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26779 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml,
int flags, PyObject* qualname,
26780 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26781 __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
26785 __Pyx_CyFunction_weakreflist(op) = NULL;
26786 op->func.m_ml = ml;
26787 op->func.m_self = (PyObject *) op;
26788 Py_XINCREF(closure);
26789 op->func_closure = closure;
26790 Py_XINCREF(module);
26791 op->func.m_module = module;
26792 op->func_dict = NULL;
26793 op->func_name = NULL;
26794 Py_INCREF(qualname);
26795 op->func_qualname = qualname;
26796 op->func_doc = NULL;
26797 op->func_classobj = NULL;
26798 op->func_globals = globals;
26799 Py_INCREF(op->func_globals);
26801 op->func_code = code;
26802 op->defaults_pyobjects = 0;
26803 op->defaults = NULL;
26804 op->defaults_tuple = NULL;
26805 op->defaults_kwdict = NULL;
26806 op->defaults_getter = NULL;
26807 op->func_annotations = NULL;
26808 PyObject_GC_Track(op);
26809 return (PyObject *) op;
26812 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
26814 Py_CLEAR(m->func_closure);
26815 Py_CLEAR(m->func.m_module);
26816 Py_CLEAR(m->func_dict);
26817 Py_CLEAR(m->func_name);
26818 Py_CLEAR(m->func_qualname);
26819 Py_CLEAR(m->func_doc);
26820 Py_CLEAR(m->func_globals);
26821 Py_CLEAR(m->func_code);
26822 Py_CLEAR(m->func_classobj);
26823 Py_CLEAR(m->defaults_tuple);
26824 Py_CLEAR(m->defaults_kwdict);
26825 Py_CLEAR(m->func_annotations);
26827 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26829 for (i = 0; i < m->defaults_pyobjects; i++)
26830 Py_XDECREF(pydefaults[i]);
26831 PyObject_Free(m->defaults);
26832 m->defaults = NULL;
26836 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26838 if (__Pyx_CyFunction_weakreflist(m) != NULL)
26839 PyObject_ClearWeakRefs((PyObject *) m);
26840 __Pyx_CyFunction_clear(m);
26841 PyObject_GC_Del(m);
26843 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26845 PyObject_GC_UnTrack(m);
26846 __Pyx__CyFunction_dealloc(m);
26848 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
26850 Py_VISIT(m->func_closure);
26851 Py_VISIT(m->func.m_module);
26852 Py_VISIT(m->func_dict);
26853 Py_VISIT(m->func_name);
26854 Py_VISIT(m->func_qualname);
26855 Py_VISIT(m->func_doc);
26856 Py_VISIT(m->func_globals);
26857 Py_VISIT(m->func_code);
26858 Py_VISIT(m->func_classobj);
26859 Py_VISIT(m->defaults_tuple);
26860 Py_VISIT(m->defaults_kwdict);
26862 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26864 for (i = 0; i < m->defaults_pyobjects; i++)
26865 Py_VISIT(pydefaults[i]);
26869 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26871 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26872 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26876 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26878 type = (PyObject *)(Py_TYPE(obj));
26879 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26881 if (obj == Py_None)
26883 return __Pyx_PyMethod_New(func, obj, type);
26886 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26888 #if PY_MAJOR_VERSION >= 3
26889 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
26890 op->func_qualname, (
void *)op);
26892 return PyString_FromFormat(
"<cyfunction %s at %p>",
26893 PyString_AsString(op->func_qualname), (
void *)op);
26896 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
26897 PyCFunctionObject*
f = (PyCFunctionObject*)func;
26898 PyCFunction meth =
f->m_ml->ml_meth;
26900 switch (
f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26902 if (likely(kw == NULL || PyDict_Size(kw) == 0))
26903 return (*meth)(
self, arg);
26905 case METH_VARARGS | METH_KEYWORDS:
26906 return (*(PyCFunctionWithKeywords)meth)(
self, arg, kw);
26908 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26909 size = PyTuple_GET_SIZE(arg);
26910 if (likely(size == 0))
26911 return (*meth)(
self, NULL);
26912 PyErr_Format(PyExc_TypeError,
26913 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26914 f->m_ml->ml_name, size);
26919 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26920 size = PyTuple_GET_SIZE(arg);
26921 if (likely(size == 1)) {
26922 PyObject *result, *arg0;
26923 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26924 arg0 = PyTuple_GET_ITEM(arg, 0);
26926 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
26928 result = (*meth)(
self, arg0);
26929 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26934 PyErr_Format(PyExc_TypeError,
26935 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26936 f->m_ml->ml_name, size);
26941 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
26942 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26943 "longer supported!");
26946 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
26950 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26951 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26953 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26955 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26956 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26958 PyObject *new_args;
26960 argc = PyTuple_GET_SIZE(args);
26961 new_args = PyTuple_GetSlice(args, 1, argc);
26962 if (unlikely(!new_args))
26964 self = PyTuple_GetItem(args, 0);
26965 if (unlikely(!
self)) {
26966 Py_DECREF(new_args);
26969 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
26970 Py_DECREF(new_args);
26972 result = __Pyx_CyFunction_Call(func, args, kw);
26976 static PyTypeObject __pyx_CyFunctionType_type = {
26977 PyVarObject_HEAD_INIT(0, 0)
26978 "cython_function_or_method",
26979 sizeof(__pyx_CyFunctionObject),
26981 (destructor) __Pyx_CyFunction_dealloc,
26985 #if PY_MAJOR_VERSION < 3
26990 (reprfunc) __Pyx_CyFunction_repr,
26995 __Pyx_CyFunction_CallAsMethod,
27000 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
27002 (traverseproc) __Pyx_CyFunction_traverse,
27003 (inquiry) __Pyx_CyFunction_clear,
27005 #
if PY_VERSION_HEX < 0x030500A0
27006 offsetof(__pyx_CyFunctionObject, func_weakreflist),
27008 offsetof(PyCFunctionObject, m_weakreflist),
27012 __pyx_CyFunction_methods,
27013 __pyx_CyFunction_members,
27014 __pyx_CyFunction_getsets,
27017 __Pyx_CyFunction_descr_get,
27019 offsetof(__pyx_CyFunctionObject, func_dict),
27032 #if PY_VERSION_HEX >= 0x030400a1
27036 static int __pyx_CyFunction_init(
void) {
27037 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
27038 if (unlikely(__pyx_CyFunctionType == NULL)) {
27043 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
27044 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27045 m->defaults = PyObject_Malloc(size);
27046 if (unlikely(!m->defaults))
27047 return PyErr_NoMemory();
27048 memset(m->defaults, 0, size);
27049 m->defaults_pyobjects = pyobjects;
27050 return m->defaults;
27052 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
27053 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27054 m->defaults_tuple = tuple;
27057 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
27058 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27059 m->defaults_kwdict = dict;
27062 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
27063 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27064 m->func_annotations = dict;
27069 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
27070 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
27073 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
27075 PyObject *pargs = PyTuple_Pack(2, name, bases);
27076 if (unlikely(!pargs)) {
27080 ns = PyObject_Call(prep, pargs, mkw);
27084 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
27094 if (unlikely(PyObject_SetItem(
ns, __pyx_n_s_module, modname) < 0))
goto bad;
27095 if (unlikely(PyObject_SetItem(
ns, __pyx_n_s_qualname, qualname) < 0))
goto bad;
27096 if (unlikely(doc && PyObject_SetItem(
ns, __pyx_n_s_doc, doc) < 0))
goto bad;
27102 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
27103 PyObject *dict, PyObject *mkw,
27104 int calculate_metaclass,
int allow_py2_metaclass) {
27105 PyObject *result, *margs;
27106 PyObject *owned_metaclass = NULL;
27107 if (allow_py2_metaclass) {
27108 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
27109 if (owned_metaclass) {
27110 metaclass = owned_metaclass;
27111 }
else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
27117 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
27118 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
27119 Py_XDECREF(owned_metaclass);
27120 if (unlikely(!metaclass))
27122 owned_metaclass = metaclass;
27124 margs = PyTuple_Pack(3, name, bases, dict);
27125 if (unlikely(!margs)) {
27128 result = PyObject_Call(metaclass, margs, mkw);
27131 Py_XDECREF(owned_metaclass);
27136 #ifndef CYTHON_CLINE_IN_TRACEBACK
27137 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
27138 PyObject *use_cline;
27139 PyObject *ptype, *pvalue, *ptraceback;
27140 #if CYTHON_COMPILING_IN_CPYTHON
27141 PyObject **cython_runtime_dict;
27143 if (unlikely(!__pyx_cython_runtime)) {
27146 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
27147 #if CYTHON_COMPILING_IN_CPYTHON
27148 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
27149 if (likely(cython_runtime_dict)) {
27150 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
27154 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
27155 if (use_cline_obj) {
27156 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
27157 Py_DECREF(use_cline_obj);
27165 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
27167 else if (PyObject_Not(use_cline) != 0) {
27170 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
27176 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
27177 int start = 0, mid = 0, end = count - 1;
27178 if (end >= 0 && code_line > entries[end].code_line) {
27181 while (start < end) {
27182 mid = start + (end - start) / 2;
27183 if (code_line < entries[mid].code_line) {
27185 }
else if (code_line > entries[mid].code_line) {
27191 if (code_line <= entries[mid].code_line) {
27197 static PyCodeObject *__pyx_find_code_object(
int code_line) {
27198 PyCodeObject* code_object;
27200 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
27203 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27204 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
27207 code_object = __pyx_code_cache.entries[
pos].code_object;
27208 Py_INCREF(code_object);
27209 return code_object;
27211 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
27213 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
27214 if (unlikely(!code_line)) {
27217 if (unlikely(!entries)) {
27218 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
27219 if (likely(entries)) {
27220 __pyx_code_cache.entries = entries;
27221 __pyx_code_cache.max_count = 64;
27222 __pyx_code_cache.count = 1;
27223 entries[0].code_line = code_line;
27224 entries[0].code_object = code_object;
27225 Py_INCREF(code_object);
27229 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27230 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
27231 PyCodeObject* tmp = entries[
pos].code_object;
27232 entries[
pos].code_object = code_object;
27236 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
27237 int new_max = __pyx_code_cache.max_count + 64;
27238 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
27239 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
27240 if (unlikely(!entries)) {
27243 __pyx_code_cache.entries = entries;
27244 __pyx_code_cache.max_count = new_max;
27246 for (i=__pyx_code_cache.count; i>
pos; i--) {
27247 entries[i] = entries[i-1];
27249 entries[
pos].code_line = code_line;
27250 entries[
pos].code_object = code_object;
27251 __pyx_code_cache.count++;
27252 Py_INCREF(code_object);
27256 #include "compile.h"
27257 #include "frameobject.h"
27258 #include "traceback.h"
27259 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
27260 const char *funcname,
int c_line,
27261 int py_line,
const char *filename) {
27262 PyCodeObject *py_code = 0;
27263 PyObject *py_srcfile = 0;
27264 PyObject *py_funcname = 0;
27265 #if PY_MAJOR_VERSION < 3
27266 py_srcfile = PyString_FromString(filename);
27268 py_srcfile = PyUnicode_FromString(filename);
27270 if (!py_srcfile)
goto bad;
27272 #if PY_MAJOR_VERSION < 3
27273 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27275 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27279 #if PY_MAJOR_VERSION < 3
27280 py_funcname = PyString_FromString(funcname);
27282 py_funcname = PyUnicode_FromString(funcname);
27285 if (!py_funcname)
goto bad;
27286 py_code = __Pyx_PyCode_New(
27303 Py_DECREF(py_srcfile);
27304 Py_DECREF(py_funcname);
27307 Py_XDECREF(py_srcfile);
27308 Py_XDECREF(py_funcname);
27311 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
27312 int py_line,
const char *filename) {
27313 PyCodeObject *py_code = 0;
27314 PyFrameObject *py_frame = 0;
27315 PyThreadState *tstate = __Pyx_PyThreadState_Current;
27317 c_line = __Pyx_CLineForTraceback(tstate, c_line);
27319 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27321 py_code = __Pyx_CreateCodeObjectForTraceback(
27322 funcname, c_line, py_line, filename);
27323 if (!py_code)
goto bad;
27324 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27326 py_frame = PyFrame_New(
27332 if (!py_frame)
goto bad;
27333 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27334 PyTraceBack_Here(py_frame);
27336 Py_XDECREF(py_code);
27337 Py_XDECREF(py_frame);
27340 #if PY_MAJOR_VERSION < 3
27341 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
27342 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
27343 if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray))
return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
27344 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
27345 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
27346 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27349 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27350 PyObject *obj = view->obj;
27352 if (PyObject_CheckBuffer(obj)) {
27353 PyBuffer_Release(view);
27357 else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
27366 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
27368 int i, index, step, start;
27369 Py_ssize_t itemsize = mvs.memview->view.itemsize;
27370 if (order ==
'F') {
27377 for (i = 0; i < ndim; i++) {
27378 index = start + step * i;
27379 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27381 itemsize *= mvs.shape[index];
27388 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27389 void **out_start,
void **out_end,
27390 int ndim,
size_t itemsize)
27394 start = end = slice->data;
27395 for (i = 0; i < ndim; i++) {
27396 Py_ssize_t stride = slice->strides[i];
27397 Py_ssize_t extent = slice->shape[i];
27399 *out_start = *out_end = start;
27403 end += stride * (extent - 1);
27405 start += stride * (extent - 1);
27408 *out_start = start;
27409 *out_end = end + itemsize;
27412 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27413 __Pyx_memviewslice *slice2,
27414 int ndim,
size_t itemsize)
27416 void *start1, *end1, *start2, *end2;
27417 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27418 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27419 return (start1 < end2) && (start2 < end1);
27423 static CYTHON_INLINE PyObject *
27424 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
27427 #if PY_VERSION_HEX >= 0x02070000
27428 cobj = PyCapsule_New(p, sig, NULL);
27430 cobj = PyCObject_FromVoidPtr(p, NULL);
27436 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27437 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27438 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27439 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27440 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27442 func_type value = func_value;\
27443 if (sizeof(target_type) < sizeof(func_type)) {\
27444 if (unlikely(value != (func_type) (target_type) value)) {\
27445 func_type zero = 0;\
27446 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27447 return (target_type) -1;\
27448 if (is_unsigned && unlikely(value < zero))\
27449 goto raise_neg_overflow;\
27451 goto raise_overflow;\
27454 return (target_type) value;\
27458 #if CYTHON_CCOMPLEX
27460 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27461 return ::std::complex< float >(x, y);
27464 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27465 return x + y*(__pyx_t_float_complex)_Complex_I;
27469 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27470 __pyx_t_float_complex
z;
27478 #if CYTHON_CCOMPLEX
27480 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27481 return (a.real == b.real) && (a.imag == b.imag);
27483 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27484 __pyx_t_float_complex
z;
27485 z.real = a.real + b.real;
27486 z.imag = a.imag + b.imag;
27489 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27490 __pyx_t_float_complex
z;
27491 z.real = a.real - b.real;
27492 z.imag = a.imag - b.imag;
27495 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27496 __pyx_t_float_complex
z;
27497 z.real = a.real * b.real - a.imag * b.imag;
27498 z.imag = a.real * b.imag + a.imag * b.real;
27502 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27504 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27505 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
27506 if (b.real == 0 && b.imag == 0) {
27507 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27509 float r = b.imag / b.real;
27510 float s = 1.0 / (b.real + b.imag *
r);
27511 return __pyx_t_float_complex_from_parts(
27512 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
27515 float r = b.real / b.imag;
27516 float s = 1.0 / (b.imag + b.real *
r);
27517 return __pyx_t_float_complex_from_parts(
27518 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
27522 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27524 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27526 float denom = b.real * b.real + b.imag * b.imag;
27527 return __pyx_t_float_complex_from_parts(
27528 (a.real * b.real + a.imag * b.imag) / denom,
27529 (a.imag * b.real - a.real * b.imag) / denom);
27533 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27534 __pyx_t_float_complex
z;
27539 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27540 return (a.real == 0) && (a.imag == 0);
27542 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27543 __pyx_t_float_complex
z;
27549 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
27550 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27551 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
27553 return hypotf(
z.real,
z.imag);
27556 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27557 __pyx_t_float_complex
z;
27558 float r, lnr, theta, z_r, z_theta;
27559 if (b.imag == 0 && b.real == (
int)b.real) {
27561 float denom = a.real * a.real + a.imag * a.imag;
27562 a.real = a.real / denom;
27563 a.imag = -a.imag / denom;
27566 switch ((
int)b.real) {
27574 z = __Pyx_c_prod_float(a, a);
27575 return __Pyx_c_prod_float(a, a);
27577 z = __Pyx_c_prod_float(a, a);
27578 return __Pyx_c_prod_float(
z, a);
27580 z = __Pyx_c_prod_float(a, a);
27581 return __Pyx_c_prod_float(
z,
z);
27587 }
else if (b.imag == 0) {
27588 z.real = powf(a.real, b.real);
27591 }
else if (a.real > 0) {
27596 theta = atan2f(0, -1);
27599 r = __Pyx_c_abs_float(a);
27600 theta = atan2f(a.imag, a.real);
27603 z_r = expf(lnr * b.real - theta * b.imag);
27604 z_theta = theta * b.real + lnr * b.imag;
27605 z.real = z_r * cosf(z_theta);
27606 z.imag = z_r * sinf(z_theta);
27613 #if CYTHON_CCOMPLEX
27615 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27616 return ::std::complex< double >(x, y);
27619 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27620 return x + y*(__pyx_t_double_complex)_Complex_I;
27624 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27625 __pyx_t_double_complex
z;
27633 #if CYTHON_CCOMPLEX
27635 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27636 return (a.real == b.real) && (a.imag == b.imag);
27638 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27639 __pyx_t_double_complex
z;
27640 z.real = a.real + b.real;
27641 z.imag = a.imag + b.imag;
27644 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27645 __pyx_t_double_complex
z;
27646 z.real = a.real - b.real;
27647 z.imag = a.imag - b.imag;
27650 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27651 __pyx_t_double_complex
z;
27652 z.real = a.real * b.real - a.imag * b.imag;
27653 z.imag = a.real * b.imag + a.imag * b.real;
27657 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27659 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27660 }
else if (fabs(b.real) >= fabs(b.imag)) {
27661 if (b.real == 0 && b.imag == 0) {
27662 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27664 double r = b.imag / b.real;
27665 double s = 1.0 / (b.real + b.imag *
r);
27666 return __pyx_t_double_complex_from_parts(
27667 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
27670 double r = b.real / b.imag;
27671 double s = 1.0 / (b.imag + b.real *
r);
27672 return __pyx_t_double_complex_from_parts(
27673 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
27677 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27679 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27681 double denom = b.real * b.real + b.imag * b.imag;
27682 return __pyx_t_double_complex_from_parts(
27683 (a.real * b.real + a.imag * b.imag) / denom,
27684 (a.imag * b.real - a.real * b.imag) / denom);
27688 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27689 __pyx_t_double_complex
z;
27694 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27695 return (a.real == 0) && (a.imag == 0);
27697 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27698 __pyx_t_double_complex
z;
27704 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
27705 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27706 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
27708 return hypot(
z.real,
z.imag);
27711 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27712 __pyx_t_double_complex
z;
27713 double r, lnr, theta, z_r, z_theta;
27714 if (b.imag == 0 && b.real == (
int)b.real) {
27716 double denom = a.real * a.real + a.imag * a.imag;
27717 a.real = a.real / denom;
27718 a.imag = -a.imag / denom;
27721 switch ((
int)b.real) {
27729 z = __Pyx_c_prod_double(a, a);
27730 return __Pyx_c_prod_double(a, a);
27732 z = __Pyx_c_prod_double(a, a);
27733 return __Pyx_c_prod_double(
z, a);
27735 z = __Pyx_c_prod_double(a, a);
27736 return __Pyx_c_prod_double(
z,
z);
27742 }
else if (b.imag == 0) {
27743 z.real = pow(a.real, b.real);
27746 }
else if (a.real > 0) {
27751 theta = atan2(0, -1);
27754 r = __Pyx_c_abs_double(a);
27755 theta = atan2(a.imag, a.real);
27758 z_r = exp(lnr * b.real - theta * b.imag);
27759 z_theta = theta * b.real + lnr * b.imag;
27760 z.real = z_r * cos(z_theta);
27761 z.imag = z_r * sin(z_theta);
27768 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
27769 const int neg_one = (int) -1, const_zero = (
int) 0;
27770 const int is_unsigned = neg_one > const_zero;
27772 if (
sizeof(
int) <
sizeof(long)) {
27773 return PyInt_FromLong((
long) value);
27774 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27775 return PyLong_FromUnsignedLong((
unsigned long) value);
27776 #ifdef HAVE_LONG_LONG
27777 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27778 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27782 if (
sizeof(
int) <=
sizeof(
long)) {
27783 return PyInt_FromLong((
long) value);
27784 #ifdef HAVE_LONG_LONG
27785 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27786 return PyLong_FromLongLong((PY_LONG_LONG) value);
27791 int one = 1;
int little = (int)*(
unsigned char *)&one;
27792 unsigned char *bytes = (
unsigned char *)&value;
27793 return _PyLong_FromByteArray(bytes,
sizeof(
int),
27794 little, !is_unsigned);
27799 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value) {
27800 const enum NPY_TYPES neg_one = (
enum NPY_TYPES) -1, const_zero = (
enum NPY_TYPES) 0;
27801 const int is_unsigned = neg_one > const_zero;
27803 if (
sizeof(
enum NPY_TYPES) <
sizeof(long)) {
27804 return PyInt_FromLong((
long) value);
27805 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned long)) {
27806 return PyLong_FromUnsignedLong((
unsigned long) value);
27807 #ifdef HAVE_LONG_LONG
27808 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned PY_LONG_LONG)) {
27809 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27813 if (
sizeof(
enum NPY_TYPES) <=
sizeof(
long)) {
27814 return PyInt_FromLong((
long) value);
27815 #ifdef HAVE_LONG_LONG
27816 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(PY_LONG_LONG)) {
27817 return PyLong_FromLongLong((PY_LONG_LONG) value);
27822 int one = 1;
int little = (int)*(
unsigned char *)&one;
27823 unsigned char *bytes = (
unsigned char *)&value;
27824 return _PyLong_FromByteArray(bytes,
sizeof(
enum NPY_TYPES),
27825 little, !is_unsigned);
27830 static __Pyx_memviewslice
27831 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
27832 const char *mode,
int ndim,
27833 size_t sizeof_dtype,
int contig_flag,
27834 int dtype_is_object)
27836 __Pyx_RefNannyDeclarations
27838 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27839 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27840 Py_buffer *buf = &from_memview->view;
27841 PyObject *shape_tuple = NULL;
27842 PyObject *temp_int = NULL;
27843 struct __pyx_array_obj *array_obj = NULL;
27844 struct __pyx_memoryview_obj *memview_obj = NULL;
27845 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
27846 for (i = 0; i < ndim; i++) {
27847 if (from_mvs->suboffsets[i] >= 0) {
27848 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
27849 "indirect dimensions (axis %d)", i);
27853 shape_tuple = PyTuple_New(ndim);
27854 if (unlikely(!shape_tuple)) {
27857 __Pyx_GOTREF(shape_tuple);
27858 for(i = 0; i < ndim; i++) {
27859 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27860 if(unlikely(!temp_int)) {
27863 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27867 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
27868 if (unlikely(!array_obj)) {
27871 __Pyx_GOTREF(array_obj);
27872 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27873 (PyObject *) array_obj, contig_flag,
27875 from_mvs->memview->typeinfo);
27876 if (unlikely(!memview_obj))
27878 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27880 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27881 dtype_is_object) < 0))
27885 __Pyx_XDECREF(new_mvs.memview);
27886 new_mvs.memview = NULL;
27887 new_mvs.data = NULL;
27889 __Pyx_XDECREF(shape_tuple);
27890 __Pyx_XDECREF(temp_int);
27891 __Pyx_XDECREF(array_obj);
27892 __Pyx_RefNannyFinishContext();
27897 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
27898 const int neg_one = (int) -1, const_zero = (
int) 0;
27899 const int is_unsigned = neg_one > const_zero;
27900 #if PY_MAJOR_VERSION < 3
27901 if (likely(PyInt_Check(x))) {
27902 if (
sizeof(
int) <
sizeof(long)) {
27903 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
27905 long val = PyInt_AS_LONG(x);
27906 if (is_unsigned && unlikely(val < 0)) {
27907 goto raise_neg_overflow;
27913 if (likely(PyLong_Check(x))) {
27915 #if CYTHON_USE_PYLONG_INTERNALS
27916 const digit* digits = ((PyLongObject*)x)->ob_digit;
27917 switch (Py_SIZE(x)) {
27918 case 0:
return (
int) 0;
27919 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
27921 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27922 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27923 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27924 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
27925 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27930 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27931 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27932 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27933 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
27934 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27939 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27940 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27941 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27942 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
27943 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27949 #if CYTHON_COMPILING_IN_CPYTHON
27950 if (unlikely(Py_SIZE(x) < 0)) {
27951 goto raise_neg_overflow;
27955 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27956 if (unlikely(result < 0))
27958 if (unlikely(result == 1))
27959 goto raise_neg_overflow;
27962 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27963 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
27964 #ifdef HAVE_LONG_LONG
27965 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27966 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27970 #if CYTHON_USE_PYLONG_INTERNALS
27971 const digit* digits = ((PyLongObject*)x)->ob_digit;
27972 switch (Py_SIZE(x)) {
27973 case 0:
return (
int) 0;
27974 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
27975 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
27977 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
27978 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27979 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27980 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27981 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27986 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27987 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27988 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27989 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27990 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27995 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27996 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27997 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27998 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27999 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28004 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
28005 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28006 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28007 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28008 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28013 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28014 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28015 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28016 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28017 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28022 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
28023 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28024 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28025 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28026 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28032 if (
sizeof(
int) <=
sizeof(long)) {
28033 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
28034 #ifdef HAVE_LONG_LONG
28035 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28036 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
28041 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28042 PyErr_SetString(PyExc_RuntimeError,
28043 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28046 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28047 #if PY_MAJOR_VERSION < 3
28048 if (likely(
v) && !PyLong_Check(
v)) {
28050 v = PyNumber_Long(tmp);
28055 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28056 unsigned char *bytes = (
unsigned char *)&val;
28057 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28058 bytes,
sizeof(val),
28059 is_little, !is_unsigned);
28069 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28070 if (!tmp)
return (
int) -1;
28071 val = __Pyx_PyInt_As_int(tmp);
28076 PyErr_SetString(PyExc_OverflowError,
28077 "value too large to convert to int");
28079 raise_neg_overflow:
28080 PyErr_SetString(PyExc_OverflowError,
28081 "can't convert negative value to int");
28086 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
28087 const long neg_one = (long) -1, const_zero = (
long) 0;
28088 const int is_unsigned = neg_one > const_zero;
28089 #if PY_MAJOR_VERSION < 3
28090 if (likely(PyInt_Check(x))) {
28091 if (
sizeof(
long) <
sizeof(long)) {
28092 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
28094 long val = PyInt_AS_LONG(x);
28095 if (is_unsigned && unlikely(val < 0)) {
28096 goto raise_neg_overflow;
28102 if (likely(PyLong_Check(x))) {
28104 #if CYTHON_USE_PYLONG_INTERNALS
28105 const digit* digits = ((PyLongObject*)x)->ob_digit;
28106 switch (Py_SIZE(x)) {
28107 case 0:
return (
long) 0;
28108 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
28110 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28111 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28112 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28113 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
28114 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28119 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28120 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28121 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28122 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
28123 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28128 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28129 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28130 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28131 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
28132 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28138 #if CYTHON_COMPILING_IN_CPYTHON
28139 if (unlikely(Py_SIZE(x) < 0)) {
28140 goto raise_neg_overflow;
28144 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28145 if (unlikely(result < 0))
28147 if (unlikely(result == 1))
28148 goto raise_neg_overflow;
28151 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28152 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
28153 #ifdef HAVE_LONG_LONG
28154 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28155 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28159 #if CYTHON_USE_PYLONG_INTERNALS
28160 const digit* digits = ((PyLongObject*)x)->ob_digit;
28161 switch (Py_SIZE(x)) {
28162 case 0:
return (
long) 0;
28163 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
28164 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
28166 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
28167 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28168 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28169 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28170 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28175 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28176 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28177 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28178 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28179 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28184 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28185 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28186 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28187 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28188 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28193 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28194 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28195 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28196 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28197 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28202 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28203 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28204 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28205 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28206 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28211 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28212 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28213 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28214 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28215 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28221 if (
sizeof(
long) <=
sizeof(long)) {
28222 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
28223 #ifdef HAVE_LONG_LONG
28224 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28225 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
28230 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28231 PyErr_SetString(PyExc_RuntimeError,
28232 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28235 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28236 #if PY_MAJOR_VERSION < 3
28237 if (likely(
v) && !PyLong_Check(
v)) {
28239 v = PyNumber_Long(tmp);
28244 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28245 unsigned char *bytes = (
unsigned char *)&val;
28246 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28247 bytes,
sizeof(val),
28248 is_little, !is_unsigned);
28258 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28259 if (!tmp)
return (
long) -1;
28260 val = __Pyx_PyInt_As_long(tmp);
28265 PyErr_SetString(PyExc_OverflowError,
28266 "value too large to convert to long");
28268 raise_neg_overflow:
28269 PyErr_SetString(PyExc_OverflowError,
28270 "can't convert negative value to long");
28275 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
28276 const long neg_one = (long) -1, const_zero = (
long) 0;
28277 const int is_unsigned = neg_one > const_zero;
28279 if (
sizeof(
long) <
sizeof(long)) {
28280 return PyInt_FromLong((
long) value);
28281 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28282 return PyLong_FromUnsignedLong((
unsigned long) value);
28283 #ifdef HAVE_LONG_LONG
28284 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28285 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28289 if (
sizeof(
long) <=
sizeof(
long)) {
28290 return PyInt_FromLong((
long) value);
28291 #ifdef HAVE_LONG_LONG
28292 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28293 return PyLong_FromLongLong((PY_LONG_LONG) value);
28298 int one = 1;
int little = (int)*(
unsigned char *)&one;
28299 unsigned char *bytes = (
unsigned char *)&value;
28300 return _PyLong_FromByteArray(bytes,
sizeof(
long),
28301 little, !is_unsigned);
28306 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
28307 const char neg_one = (char) -1, const_zero = (
char) 0;
28308 const int is_unsigned = neg_one > const_zero;
28309 #if PY_MAJOR_VERSION < 3
28310 if (likely(PyInt_Check(x))) {
28311 if (
sizeof(
char) <
sizeof(long)) {
28312 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
28314 long val = PyInt_AS_LONG(x);
28315 if (is_unsigned && unlikely(val < 0)) {
28316 goto raise_neg_overflow;
28322 if (likely(PyLong_Check(x))) {
28324 #if CYTHON_USE_PYLONG_INTERNALS
28325 const digit* digits = ((PyLongObject*)x)->ob_digit;
28326 switch (Py_SIZE(x)) {
28327 case 0:
return (
char) 0;
28328 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
28330 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28331 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28332 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28333 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
28334 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28339 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28340 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28341 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28342 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
28343 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28348 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28349 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28350 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28351 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
28352 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28358 #if CYTHON_COMPILING_IN_CPYTHON
28359 if (unlikely(Py_SIZE(x) < 0)) {
28360 goto raise_neg_overflow;
28364 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28365 if (unlikely(result < 0))
28367 if (unlikely(result == 1))
28368 goto raise_neg_overflow;
28371 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
28372 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
28373 #ifdef HAVE_LONG_LONG
28374 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
28375 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28379 #if CYTHON_USE_PYLONG_INTERNALS
28380 const digit* digits = ((PyLongObject*)x)->ob_digit;
28381 switch (Py_SIZE(x)) {
28382 case 0:
return (
char) 0;
28383 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
28384 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
28386 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
28387 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28388 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28389 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28390 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28395 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28396 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28397 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28398 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28399 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28404 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28405 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28406 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28407 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28408 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28413 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28414 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28415 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28416 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28417 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28422 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28423 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28424 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28425 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28426 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28431 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28432 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28433 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28434 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28435 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28441 if (
sizeof(
char) <=
sizeof(long)) {
28442 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
28443 #ifdef HAVE_LONG_LONG
28444 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
28445 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
28450 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28451 PyErr_SetString(PyExc_RuntimeError,
28452 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28455 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28456 #if PY_MAJOR_VERSION < 3
28457 if (likely(
v) && !PyLong_Check(
v)) {
28459 v = PyNumber_Long(tmp);
28464 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28465 unsigned char *bytes = (
unsigned char *)&val;
28466 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28467 bytes,
sizeof(val),
28468 is_little, !is_unsigned);
28478 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28479 if (!tmp)
return (
char) -1;
28480 val = __Pyx_PyInt_As_char(tmp);
28485 PyErr_SetString(PyExc_OverflowError,
28486 "value too large to convert to char");
28488 raise_neg_overflow:
28489 PyErr_SetString(PyExc_OverflowError,
28490 "can't convert negative value to char");
28495 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
28501 S.u32 = 0x01020304;
28502 return S.u8[0] == 4;
28506 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
28507 __Pyx_BufFmt_StackElem* stack,
28508 __Pyx_TypeInfo* type) {
28509 stack[0].field = &ctx->root;
28510 stack[0].parent_offset = 0;
28511 ctx->root.type = type;
28512 ctx->root.name =
"buffer dtype";
28513 ctx->root.offset = 0;
28515 ctx->head->field = &ctx->root;
28516 ctx->fmt_offset = 0;
28517 ctx->head->parent_offset = 0;
28518 ctx->new_packmode =
'@';
28519 ctx->enc_packmode =
'@';
28520 ctx->new_count = 1;
28521 ctx->enc_count = 0;
28523 ctx->is_complex = 0;
28524 ctx->is_valid_array = 0;
28525 ctx->struct_alignment = 0;
28526 while (type->typegroup ==
'S') {
28528 ctx->head->field = type->fields;
28529 ctx->head->parent_offset = 0;
28530 type = type->fields->type;
28533 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
28535 const char* t = *ts;
28536 if (*t < '0' || *t >
'9') {
28539 count = *t++ -
'0';
28540 while (*t >=
'0' && *t <
'9') {
28542 count += *t++ -
'0';
28548 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
28549 int number = __Pyx_BufFmt_ParseNumber(ts);
28551 PyErr_Format(PyExc_ValueError,\
28552 "Does not understand character buffer dtype format string ('%c')", **ts);
28555 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
28556 PyErr_Format(PyExc_ValueError,
28557 "Unexpected format string character: '%c'", ch);
28559 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
28561 case 'c':
return "'char'";
28562 case 'b':
return "'signed char'";
28563 case 'B':
return "'unsigned char'";
28564 case 'h':
return "'short'";
28565 case 'H':
return "'unsigned short'";
28566 case 'i':
return "'int'";
28567 case 'I':
return "'unsigned int'";
28568 case 'l':
return "'long'";
28569 case 'L':
return "'unsigned long'";
28570 case 'q':
return "'long long'";
28571 case 'Q':
return "'unsigned long long'";
28572 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
28573 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
28574 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
28575 case 'T':
return "a struct";
28576 case 'O':
return "Python object";
28577 case 'P':
return "a pointer";
28578 case 's':
case 'p':
return "a string";
28579 case 0:
return "end";
28580 default:
return "unparseable format string";
28583 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
28585 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28586 case 'h':
case 'H':
return 2;
28587 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
28588 case 'q':
case 'Q':
return 8;
28589 case 'f':
return (is_complex ? 8 : 4);
28590 case 'd':
return (is_complex ? 16 : 8);
28592 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
28595 case 'O':
case 'P':
return sizeof(
void*);
28597 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28601 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
28603 case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28604 case 'h':
case 'H':
return sizeof(short);
28605 case 'i':
case 'I':
return sizeof(int);
28606 case 'l':
case 'L':
return sizeof(long);
28607 #ifdef HAVE_LONG_LONG
28608 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
28610 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
28611 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
28612 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
28613 case 'O':
case 'P':
return sizeof(
void*);
28615 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28620 typedef struct {
char c;
short x; } __Pyx_st_short;
28621 typedef struct {
char c;
int x; } __Pyx_st_int;
28622 typedef struct {
char c;
long x; } __Pyx_st_long;
28623 typedef struct {
char c;
float x; } __Pyx_st_float;
28624 typedef struct {
char c;
double x; } __Pyx_st_double;
28625 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
28626 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
28627 #ifdef HAVE_LONG_LONG
28628 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
28630 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
28632 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28633 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
28634 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
28635 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
28636 #ifdef HAVE_LONG_LONG
28637 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
28639 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
28640 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
28641 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
28642 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
28644 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28652 typedef struct {
short x;
char c; } __Pyx_pad_short;
28653 typedef struct {
int x;
char c; } __Pyx_pad_int;
28654 typedef struct {
long x;
char c; } __Pyx_pad_long;
28655 typedef struct {
float x;
char c; } __Pyx_pad_float;
28656 typedef struct {
double x;
char c; } __Pyx_pad_double;
28657 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
28658 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
28659 #ifdef HAVE_LONG_LONG
28660 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
28662 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
28664 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
28665 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
28666 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
28667 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
28668 #ifdef HAVE_LONG_LONG
28669 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
28671 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
28672 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
28673 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
28674 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
28676 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28680 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
28684 case 'b':
case 'h':
case 'i':
28685 case 'l':
case 'q':
case 's':
case 'p':
28687 case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
28689 case 'f':
case 'd':
case 'g':
28690 return (is_complex ?
'C' :
'R');
28696 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28701 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
28702 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
28703 const char* expected;
28705 if (ctx->head == NULL) {
28709 expected = ctx->head->field->type->name;
28712 PyErr_Format(PyExc_ValueError,
28713 "Buffer dtype mismatch, expected %s%s%s but got %s",
28714 quote, expected, quote,
28715 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
28717 __Pyx_StructField* field = ctx->head->field;
28718 __Pyx_StructField* parent = (ctx->head - 1)->field;
28719 PyErr_Format(PyExc_ValueError,
28720 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
28721 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
28722 parent->type->name, field->name);
28725 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
28727 size_t size, offset, arraysize = 1;
28728 if (ctx->enc_type == 0)
return 0;
28729 if (ctx->head->field->type->arraysize[0]) {
28731 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
28732 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
28734 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
28735 PyErr_Format(PyExc_ValueError,
28736 "Expected a dimension of size %zu, got %zu",
28737 ctx->head->field->type->arraysize[0], ctx->enc_count);
28741 if (!ctx->is_valid_array) {
28742 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
28743 ctx->head->field->type->ndim, ndim);
28746 for (i = 0; i < ctx->head->field->type->ndim; i++) {
28747 arraysize *= ctx->head->field->type->arraysize[i];
28749 ctx->is_valid_array = 0;
28750 ctx->enc_count = 1;
28752 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
28754 __Pyx_StructField* field = ctx->head->field;
28755 __Pyx_TypeInfo* type = field->type;
28756 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
28757 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
28759 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
28761 if (ctx->enc_packmode ==
'@') {
28762 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
28763 size_t align_mod_offset;
28764 if (align_at == 0)
return -1;
28765 align_mod_offset = ctx->fmt_offset % align_at;
28766 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
28767 if (ctx->struct_alignment == 0)
28768 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
28771 if (type->size != size || type->typegroup != group) {
28772 if (type->typegroup ==
'C' && type->fields != NULL) {
28773 size_t parent_offset = ctx->head->parent_offset + field->offset;
28775 ctx->head->field = type->fields;
28776 ctx->head->parent_offset = parent_offset;
28779 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
28781 __Pyx_BufFmt_RaiseExpected(ctx);
28785 offset = ctx->head->parent_offset + field->offset;
28786 if (ctx->fmt_offset != offset) {
28787 PyErr_Format(PyExc_ValueError,
28788 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
28789 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
28792 ctx->fmt_offset += size;
28794 ctx->fmt_offset += (arraysize - 1) * size;
28797 if (field == &ctx->root) {
28799 if (ctx->enc_count != 0) {
28800 __Pyx_BufFmt_RaiseExpected(ctx);
28805 ctx->head->field = ++field;
28806 if (field->type == NULL) {
28808 field = ctx->head->field;
28810 }
else if (field->type->typegroup ==
'S') {
28811 size_t parent_offset = ctx->head->parent_offset + field->offset;
28812 if (field->type->fields->type == NULL)
continue;
28813 field = field->type->fields;
28815 ctx->head->field = field;
28816 ctx->head->parent_offset = parent_offset;
28822 }
while (ctx->enc_count);
28824 ctx->is_complex = 0;
28828 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
28830 const char *ts = *tsp;
28832 int ndim = ctx->head->field->type->ndim;
28835 if (ctx->new_count != 1) {
28836 PyErr_SetString(PyExc_ValueError,
28837 "Cannot handle repeated arrays in format string");
28840 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28841 while (*ts && *ts !=
')') {
28843 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
28846 number = __Pyx_BufFmt_ExpectNumber(&ts);
28847 if (
number == -1)
return NULL;
28848 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
28849 return PyErr_Format(PyExc_ValueError,
28850 "Expected a dimension of size %zu, got %d",
28851 ctx->head->field->type->arraysize[i],
number);
28852 if (*ts !=
',' && *ts !=
')')
28853 return PyErr_Format(PyExc_ValueError,
28854 "Expected a comma in format string, got '%c'", *ts);
28855 if (*ts ==
',') ts++;
28859 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
28860 ctx->head->field->type->ndim, i);
28862 PyErr_SetString(PyExc_ValueError,
28863 "Unexpected end of format string, expected ')'");
28866 ctx->is_valid_array = 1;
28867 ctx->new_count = 1;
28871 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
28876 if (ctx->enc_type != 0 && ctx->head == NULL) {
28877 __Pyx_BufFmt_RaiseExpected(ctx);
28880 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28881 if (ctx->head != NULL) {
28882 __Pyx_BufFmt_RaiseExpected(ctx);
28892 if (!__Pyx_Is_Little_Endian()) {
28893 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
28896 ctx->new_packmode =
'=';
28901 if (__Pyx_Is_Little_Endian()) {
28902 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
28905 ctx->new_packmode =
'=';
28911 ctx->new_packmode = *ts++;
28915 const char* ts_after_sub;
28916 size_t i, struct_count = ctx->new_count;
28917 size_t struct_alignment = ctx->struct_alignment;
28918 ctx->new_count = 1;
28921 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
28924 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28926 ctx->enc_count = 0;
28927 ctx->struct_alignment = 0;
28930 for (i = 0; i != struct_count; ++i) {
28931 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
28932 if (!ts_after_sub)
return NULL;
28935 if (struct_alignment) ctx->struct_alignment = struct_alignment;
28940 size_t alignment = ctx->struct_alignment;
28942 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28944 if (alignment && ctx->fmt_offset % alignment) {
28945 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
28950 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28951 ctx->fmt_offset += ctx->new_count;
28952 ctx->new_count = 1;
28953 ctx->enc_count = 0;
28955 ctx->enc_packmode = ctx->new_packmode;
28961 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
28962 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
28965 CYTHON_FALLTHROUGH;
28966 case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
28967 case 'l':
case 'L':
case 'q':
case 'Q':
28968 case 'f':
case 'd':
case 'g':
28969 case 'O':
case 'p':
28970 if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
28971 ctx->enc_packmode == ctx->new_packmode) {
28972 ctx->enc_count += ctx->new_count;
28973 ctx->new_count = 1;
28978 CYTHON_FALLTHROUGH;
28980 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
28981 ctx->enc_count = ctx->new_count;
28982 ctx->enc_packmode = ctx->new_packmode;
28983 ctx->enc_type = *ts;
28984 ctx->is_complex = got_Z;
28986 ctx->new_count = 1;
28991 while(*ts !=
':') ++ts;
28995 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
28999 int number = __Pyx_BufFmt_ExpectNumber(&ts);
29000 if (
number == -1)
return NULL;
29001 ctx->new_count = (size_t)
number;
29009 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
29016 if (a->size != b->size || a->typegroup != b->typegroup ||
29017 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
29018 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
29019 return a->size == b->size;
29025 for (i = 0; i < a->ndim; i++)
29026 if (a->arraysize[i] != b->arraysize[i])
29029 if (a->typegroup ==
'S') {
29030 if (a->flags != b->flags)
29032 if (a->fields || b->fields) {
29033 if (!(a->fields && b->fields))
29035 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
29036 __Pyx_StructField *field_a = a->fields + i;
29037 __Pyx_StructField *field_b = b->fields + i;
29038 if (field_a->offset != field_b->offset ||
29039 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
29042 return !a->fields[i].type && !b->fields[i].type;
29050 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
29052 if (buf->shape[dim] <= 1)
29054 if (buf->strides) {
29055 if (spec & __Pyx_MEMVIEW_CONTIG) {
29056 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
29057 if (buf->strides[dim] !=
sizeof(
void *)) {
29058 PyErr_Format(PyExc_ValueError,
29059 "Buffer is not indirectly contiguous "
29060 "in dimension %d.", dim);
29063 }
else if (buf->strides[dim] != buf->itemsize) {
29064 PyErr_SetString(PyExc_ValueError,
29065 "Buffer and memoryview are not contiguous "
29066 "in the same dimension.");
29070 if (spec & __Pyx_MEMVIEW_FOLLOW) {
29071 Py_ssize_t stride = buf->strides[dim];
29074 if (stride < buf->itemsize) {
29075 PyErr_SetString(PyExc_ValueError,
29076 "Buffer and memoryview are not contiguous "
29077 "in the same dimension.");
29082 if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
29083 PyErr_Format(PyExc_ValueError,
29084 "C-contiguous buffer is not contiguous in "
29085 "dimension %d", dim);
29087 }
else if (spec & (__Pyx_MEMVIEW_PTR)) {
29088 PyErr_Format(PyExc_ValueError,
29089 "C-contiguous buffer is not indirect in "
29090 "dimension %d", dim);
29092 }
else if (buf->suboffsets) {
29093 PyErr_SetString(PyExc_ValueError,
29094 "Buffer exposes suboffsets but no strides");
29103 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
29105 if (spec & __Pyx_MEMVIEW_DIRECT) {
29106 if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
29107 PyErr_Format(PyExc_ValueError,
29108 "Buffer not compatible with direct access "
29109 "in dimension %d.", dim);
29113 if (spec & __Pyx_MEMVIEW_PTR) {
29114 if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
29115 PyErr_Format(PyExc_ValueError,
29116 "Buffer is not indirectly accessible "
29117 "in dimension %d.", dim);
29126 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
29129 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
29130 Py_ssize_t stride = 1;
29131 for (i = 0; i < ndim; i++) {
29132 if (stride * buf->itemsize != buf->strides[i] &&
29135 PyErr_SetString(PyExc_ValueError,
29136 "Buffer not fortran contiguous.");
29139 stride = stride * buf->shape[i];
29141 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
29142 Py_ssize_t stride = 1;
29143 for (i = ndim - 1; i >- 1; i--) {
29144 if (stride * buf->itemsize != buf->strides[i] &&
29145 buf->shape[i] > 1) {
29146 PyErr_SetString(PyExc_ValueError,
29147 "Buffer not C contiguous.");
29150 stride = stride * buf->shape[i];
29157 static int __Pyx_ValidateAndInit_memviewslice(
29162 __Pyx_TypeInfo *dtype,
29163 __Pyx_BufFmt_StackElem stack[],
29164 __Pyx_memviewslice *memviewslice,
29165 PyObject *original_obj)
29167 struct __pyx_memoryview_obj *memview, *new_memview;
29168 __Pyx_RefNannyDeclarations
29170 int i, spec = 0, retval = -1;
29171 __Pyx_BufFmt_Context ctx;
29172 int from_memoryview = __pyx_memoryview_check(original_obj);
29173 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
29174 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
29175 original_obj)->typeinfo)) {
29176 memview = (
struct __pyx_memoryview_obj *) original_obj;
29177 new_memview = NULL;
29179 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
29180 original_obj, buf_flags, 0, dtype);
29181 new_memview = memview;
29182 if (unlikely(!memview))
29185 buf = &memview->view;
29186 if (buf->ndim != ndim) {
29187 PyErr_Format(PyExc_ValueError,
29188 "Buffer has wrong number of dimensions (expected %d, got %d)",
29193 __Pyx_BufFmt_Init(&ctx, stack, dtype);
29194 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
29196 if ((
unsigned) buf->itemsize != dtype->size) {
29197 PyErr_Format(PyExc_ValueError,
29198 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
29199 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
29201 (buf->itemsize > 1) ?
"s" :
"",
29204 (dtype->size > 1) ?
"s" :
"");
29207 for (i = 0; i < ndim; i++) {
29208 spec = axes_specs[i];
29209 if (!__pyx_check_strides(buf, i, ndim, spec))
29211 if (!__pyx_check_suboffsets(buf, i, ndim, spec))
29214 if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
29216 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
29217 new_memview != NULL) == -1)) {
29223 Py_XDECREF(new_memview);
29226 __Pyx_RefNannyFinishContext();
29231 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
29232 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
29233 __Pyx_BufFmt_StackElem stack[1];
29234 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
29236 if (obj == Py_None) {
29237 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
29240 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
29241 PyBUF_RECORDS_RO | writable_flag, 1,
29242 &__Pyx_TypeInfo_double, stack,
29244 if (unlikely(retcode == -1))
29248 result.memview = NULL;
29249 result.data = NULL;
29254 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj,
int writable_flag) {
29255 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
29256 __Pyx_BufFmt_StackElem stack[1];
29257 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
29259 if (obj == Py_None) {
29260 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
29263 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
29264 PyBUF_RECORDS_RO | writable_flag, 1,
29265 &__Pyx_TypeInfo_int, stack,
29267 if (unlikely(retcode == -1))
29271 result.memview = NULL;
29272 result.data = NULL;
29277 static int __Pyx_check_binary_version(
void) {
29278 char ctversion[4], rtversion[4];
29279 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
29280 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
29281 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
29283 PyOS_snprintf(message,
sizeof(message),
29284 "compiletime version %s of module '%.100s' "
29285 "does not match runtime version %s",
29286 ctversion, __Pyx_MODULE_NAME, rtversion);
29287 return PyErr_WarnEx(NULL, message, 1);
29293 #ifndef __PYX_HAVE_RT_ImportModule
29294 #define __PYX_HAVE_RT_ImportModule
29295 static PyObject *__Pyx_ImportModule(
const char *name) {
29296 PyObject *py_name = 0;
29297 PyObject *py_module = 0;
29298 py_name = __Pyx_PyIdentifier_FromString(name);
29301 py_module = PyImport_Import(py_name);
29302 Py_DECREF(py_name);
29305 Py_XDECREF(py_name);
29311 #ifndef __PYX_HAVE_RT_ImportType
29312 #define __PYX_HAVE_RT_ImportType
29313 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
29314 size_t size,
int strict)
29316 PyObject *py_module = 0;
29317 PyObject *result = 0;
29318 PyObject *py_name = 0;
29320 Py_ssize_t basicsize;
29321 #ifdef Py_LIMITED_API
29322 PyObject *py_basicsize;
29324 py_module = __Pyx_ImportModule(module_name);
29327 py_name = __Pyx_PyIdentifier_FromString(class_name);
29330 result = PyObject_GetAttr(py_module, py_name);
29331 Py_DECREF(py_name);
29333 Py_DECREF(py_module);
29337 if (!PyType_Check(result)) {
29338 PyErr_Format(PyExc_TypeError,
29339 "%.200s.%.200s is not a type object",
29340 module_name, class_name);
29343 #ifndef Py_LIMITED_API
29344 basicsize = ((PyTypeObject *)result)->tp_basicsize;
29346 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
29349 basicsize = PyLong_AsSsize_t(py_basicsize);
29350 Py_DECREF(py_basicsize);
29352 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
29355 if (!strict && (
size_t)basicsize > size) {
29356 PyOS_snprintf(warning,
sizeof(warning),
29357 "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
29358 module_name, class_name, basicsize, size);
29359 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
29361 else if ((
size_t)basicsize != size) {
29362 PyErr_Format(PyExc_ValueError,
29363 "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
29364 module_name, class_name, basicsize, size);
29367 return (PyTypeObject *)result;
29369 Py_XDECREF(py_module);
29370 Py_XDECREF(result);
29376 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29378 #if PY_MAJOR_VERSION < 3
29379 if (t->is_unicode) {
29380 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29381 }
else if (t->intern) {
29382 *t->p = PyString_InternFromString(t->s);
29384 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29387 if (t->is_unicode | t->is_str) {
29389 *t->p = PyUnicode_InternFromString(t->s);
29390 }
else if (t->encoding) {
29391 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29393 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29396 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29401 if (PyObject_Hash(*t->p) == -1)
29408 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
29409 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29411 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
29413 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29415 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29416 #if !CYTHON_PEP393_ENABLED
29417 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29419 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29420 if (!defenc)
return NULL;
29421 defenc_c = PyBytes_AS_STRING(defenc);
29422 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29424 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29426 for (
c = defenc_c;
c < end;
c++) {
29427 if ((
unsigned char) (*
c) >= 128) {
29428 PyUnicode_AsASCIIString(o);
29434 *length = PyBytes_GET_SIZE(defenc);
29438 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29439 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
29440 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29441 if (likely(PyUnicode_IS_ASCII(o))) {
29442 *length = PyUnicode_GET_LENGTH(o);
29443 return PyUnicode_AsUTF8(o);
29445 PyUnicode_AsASCIIString(o);
29449 return PyUnicode_AsUTF8AndSize(o, length);
29454 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29455 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29457 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29458 __Pyx_sys_getdefaultencoding_not_ascii &&
29460 PyUnicode_Check(o)) {
29461 return __Pyx_PyUnicode_AsStringAndSize(o, length);
29464 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29465 if (PyByteArray_Check(o)) {
29466 *length = PyByteArray_GET_SIZE(o);
29467 return PyByteArray_AS_STRING(o);
29472 int r = PyBytes_AsStringAndSize(o, &result, length);
29473 if (unlikely(
r < 0)) {
29480 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
29481 int is_true = x == Py_True;
29482 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
29483 else return PyObject_IsTrue(x);
29485 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
29486 #if PY_MAJOR_VERSION >= 3
29487 if (PyLong_Check(result)) {
29488 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29489 "__int__ returned non-int (type %.200s). "
29490 "The ability to return an instance of a strict subclass of int "
29491 "is deprecated, and may be removed in a future version of Python.",
29492 Py_TYPE(result)->tp_name)) {
29499 PyErr_Format(PyExc_TypeError,
29500 "__%.4s__ returned non-%.4s (type %.200s)",
29501 type_name, type_name, Py_TYPE(result)->tp_name);
29505 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29506 #if CYTHON_USE_TYPE_SLOTS
29507 PyNumberMethods *m;
29509 const char *name = NULL;
29510 PyObject *res = NULL;
29511 #if PY_MAJOR_VERSION < 3
29512 if (likely(PyInt_Check(x) || PyLong_Check(x)))
29514 if (likely(PyLong_Check(x)))
29516 return __Pyx_NewRef(x);
29517 #if CYTHON_USE_TYPE_SLOTS
29518 m = Py_TYPE(x)->tp_as_number;
29519 #if PY_MAJOR_VERSION < 3
29520 if (m && m->nb_int) {
29522 res = m->nb_int(x);
29524 else if (m && m->nb_long) {
29526 res = m->nb_long(x);
29529 if (likely(m && m->nb_int)) {
29531 res = m->nb_int(x);
29535 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29536 res = PyNumber_Int(x);
29540 #if PY_MAJOR_VERSION < 3
29541 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29543 if (unlikely(!PyLong_CheckExact(res))) {
29545 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29548 else if (!PyErr_Occurred()) {
29549 PyErr_SetString(PyExc_TypeError,
29550 "an integer is required");
29554 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29557 #if PY_MAJOR_VERSION < 3
29558 if (likely(PyInt_CheckExact(b))) {
29559 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
29560 return PyInt_AS_LONG(b);
29562 return PyInt_AsSsize_t(x);
29565 if (likely(PyLong_CheckExact(b))) {
29566 #if CYTHON_USE_PYLONG_INTERNALS
29567 const digit* digits = ((PyLongObject*)b)->ob_digit;
29568 const Py_ssize_t size = Py_SIZE(b);
29569 if (likely(__Pyx_sst_abs(size) <= 1)) {
29570 ival = likely(size) ? digits[0] : 0;
29571 if (size == -1) ival = -ival;
29576 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29577 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29581 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29582 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29586 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29587 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29591 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29592 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29596 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29597 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29601 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29602 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29608 return PyLong_AsSsize_t(b);
29610 x = PyNumber_Index(b);
29612 ival = PyInt_AsSsize_t(x);
29616 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
29617 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29619 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
29620 return PyInt_FromSize_t(ival);